dbertoni 00/02/17 12:27:28
Modified: c/src/PlatformSupport AttributeListImpl.cpp
AttributeListImpl.hpp DOMStringHelper.cpp
DOMStringHelper.hpp DOMStringPrintWriter.cpp
DOMStringPrintWriter.hpp DecimalFormatSymbols.cpp
DecimalFormatSymbols.hpp DirectoryEnumerator.hpp
DoubleSupport.cpp Factory.hpp
NamedNodeMapAttributeList.cpp
NamedNodeMapAttributeList.hpp NullPrintWriter.cpp
NullPrintWriter.hpp NumberFormat.cpp
PrintWriter.hpp STLHelper.hpp Writer.hpp
Log:
Changes for Linux build, and to match latest Xerces DOM signatures.
Revision Changes Path
1.3 +17 -3 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AttributeListImpl.cpp 2000/01/25 15:19:58 1.2
+++ AttributeListImpl.cpp 2000/02/17 20:27:26 1.3
@@ -65,6 +65,7 @@
#include <util/Janitor.hpp>
+#include <util/XMLString.hpp>
@@ -116,6 +117,10 @@
AttributeListImpl&
AttributeListImpl::operator=(const AttributeListImpl& theRHS)
{
+#if !defined(XALAN_NO_NAMESPACES)
+ using std::make_pair;
+#endif
+
if (this != &theRHS)
{
// Note that we can't chain up to our base class operator=()
@@ -141,8 +146,8 @@
m_AttributeVector.push_back(theEntry);
// Create an entry in the index map...
-
m_AttributeKeyMap.insert(std::make_pair(theEntry->m_Name.begin(),
-
theEntry));
+
m_AttributeKeyMap.insert(make_pair(theEntry->m_Name.begin(),
+
theEntry));
}
assert(getLength() == theLength);
@@ -292,6 +297,9 @@
void
AttributeListImpl::clear()
{
+#if !defined(XALAN_NO_NAMESPACES)
+ using std::for_each;
+#endif
// Delete all of the objects in the vector.
std::for_each(m_AttributeVector.begin(),
m_AttributeVector.end(),
@@ -310,6 +318,10 @@
const XMLCh* const type,
const XMLCh* const value)
{
+#if !defined(XALAN_NO_NAMESPACES)
+ using std::make_pair;
+#endif
+
assert(name != 0);
assert(type != 0);
assert(value != 0);
@@ -329,7 +341,7 @@
m_AttributeVector.push_back(theEntry);
// Create an entry in the index map.
-
m_AttributeKeyMap.insert(std::make_pair(theEntry->m_Name.begin(), theEntry));
+ m_AttributeKeyMap.insert(make_pair(theEntry->m_Name.begin(),
theEntry));
fResult = true;
}
@@ -348,9 +360,11 @@
assert(name != 0);
assert(m_AttributeKeyMap.size() == m_AttributeVector.size());
+#if !defined(XALAN_NO_NAMESPACES)
using std::find_if;
using std::equal_to;
using std::bind1st;
+#endif
bool fResult = false;
1.2 +11 -0 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AttributeListImpl.hpp 1999/12/18 19:47:49 1.1
+++ AttributeListImpl.hpp 2000/02/17 20:27:26 1.2
@@ -156,7 +156,17 @@
const XMLCharVectorType m_Type;
};
+#if defined(XALAN_NO_NAMESPACES)
// This vector will hold the entries.
+ typedef vector<const AttributeVectorEntry*>
AttributeVectorType;
+
+ // This map will associate a name with a pointer to the entry that
corresponds
+ // to that name.
+ typedef map<const XMLCh*,
+ const AttributeVectorEntry*,
+ less_null_terminated_arrays<XMLCh> >
AttributeKeyMapType;
+#else
+ // This vector will hold the entries.
typedef std::vector<const AttributeVectorEntry*>
AttributeVectorType;
// This map will associate a name with a pointer to the entry that
corresponds
@@ -164,6 +174,7 @@
typedef std::map<const XMLCh*,
const AttributeVectorEntry*,
less_null_terminated_arrays<XMLCh> >
AttributeKeyMapType;
+#endif
AttributeKeyMapType m_AttributeKeyMap;
AttributeVectorType m_AttributeVector;
1.9 +55 -56 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DOMStringHelper.cpp 2000/01/31 17:41:04 1.8
+++ DOMStringHelper.cpp 2000/02/17 20:27:26 1.9
@@ -67,10 +67,23 @@
#include <strstream>
+#include <ostream>
#include <vector>
+#if !defined(XALAN_NO_NAMESPACES)
+using std::hex;
+using std::ostream;
+using std::ostrstream;
+using std::string;
+//using std::stringstream;
+using std::vector;
+using std::wstring;
+#endif
+
+
+
// Xerces header files
#include <util/Janitor.hpp>
#include <util/TextOutputStream.hpp>
@@ -328,7 +341,7 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
OutputString(
- std::ostream& theStream,
+ ostream& theStream,
const DOMString& theString)
{
char* const theTranscodedString =
@@ -418,16 +431,16 @@
equalsIgnoreCase(const DOMString& theLHS,
const DOMString& theRHS)
{
- bool fResult = false;
+ bool fResult = false;
- const int theLength = length(theLHS);
+ const unsigned int theLength = length(theLHS);
// If they are equal, then compare
if (theLength == length(theRHS))
{
// Check each character, converting to uppercase
// for the test.
- for(int i = 0; i < theLength; i++)
+ for(unsigned int i = 0; i < theLength; i++)
{
if (towupper(charAt(theLHS, i)) !=
towupper(charAt(theRHS, i)))
@@ -507,10 +520,8 @@
static void
CopyDOMStringToVector(const DOMString& theString,
- std::vector<char>& theVector)
+ vector<char>&
theVector)
{
- using std::vector;
-
const int theLength = length(theString);
if (theLength != 0)
@@ -519,15 +530,19 @@
for(int i = 0; i < theLength; i++)
{
+#if defined(XALAN_OLD_STYLE_CASTS)
+ // Assert that the truncation will not affect the
resulting character.
+ assert(charAt(theString, i) == (char)charAt(theString,
i));
+
+ theVector.push_back((char)charAt(theString, i));
+#else
// Assert that the truncation will not affect the
resulting character.
assert(charAt(theString, i) ==
static_cast<char>(charAt(theString, i)));
theVector.push_back(static_cast<char>(charAt(theString,
i)));
+#endif
}
- assert(theVector.size() ==
- static_cast<std::vector<char>::size_type >(theLength));
-
// Put a terminating 0 byte.
theVector.push_back(0);
}
@@ -539,8 +554,6 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(int)
DOMStringToInt(const DOMString& theString)
{
- using std::vector;
-
int theResult = 0;
vector<char> theVector;
@@ -561,8 +574,6 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(long)
DOMStringToLong(const DOMString& theString)
{
- using std::vector;
-
long theResult = 0;
vector<char> theVector;
@@ -583,13 +594,13 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(double)
DOMStringToDouble(const DOMString& theString)
{
- using std::vector;
-
double theResult = DoubleSupport::getNaN();
if (length(theString) > 0)
{
- vector<char> theVector;
+ typedef vector<char> VectorType;
+
+ VectorType theVector;
CopyDOMStringToVector(theString,
theVector);
@@ -600,8 +611,8 @@
// localization as well.
bool fError = false;
- std::vector<char>::const_iterator i =
theVector.begin();
- std::vector<char>::const_iterator j =
theVector.end();
+ VectorType::const_iterator i = theVector.begin();
+ VectorType::const_iterator j = theVector.end();
j--;
@@ -672,12 +683,8 @@
}
else
{
-#if !defined(XALAN_NO_NAMESPACES)
- using namespace std;
-#endif
+ ostrstream theFormatter;
- std::ostrstream theFormatter;
-
// $$$ ToDo: this is all temporary, until we get the
NumberFormat and DecimalFormat
// classes working.
// According to the XPath standard, any values without
@@ -690,8 +697,13 @@
if (fracPart == 0)
{
+#if defined(XALAN_OLD_STYLE_CASTS)
+ theFormatter << (long)theDouble << '\0';
+
+#else
theFormatter << static_cast<long>(theDouble) << '\0';
+#endif
theResult = theFormatter.str();
}
else
@@ -727,12 +739,8 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(DOMString)
LongToHexDOMString(long theLong)
{
-#if !defined(XALAN_NO_NAMESPACES)
- using namespace std;
-#endif
+ ostrstream theFormatter;
- std::ostrstream theFormatter;
-
theFormatter << hex << theLong << '\0';
return theFormatter.str();
@@ -743,11 +751,7 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(DOMString)
LongToDOMString(long theLong)
{
-#if !defined(XALAN_NO_NAMESPACES)
- using namespace std;
-#endif
-
- std::ostrstream theFormatter;
+ ostrstream theFormatter;
theFormatter << theLong << '\0';
@@ -759,12 +763,8 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(DOMString)
UnsignedLongToDOMString(unsigned long theUnsignedLong)
{
-#if !defined(XALAN_NO_NAMESPACES)
- using namespace std;
-#endif
+ ostrstream theFormatter;
- std::ostrstream theFormatter;
-
theFormatter << theUnsignedLong << '\0';
return theFormatter.str();
@@ -809,9 +809,9 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
isWhiteSpace(const DOMString& string)
{
- const int theLength = length(string);
+ const unsigned int theLength = length(string);
- for(int s = 0; s < theLength; s++)
+ for(unsigned int s = 0; s < theLength; s++)
{
if (!isSpace(charAt(string, s)))
return false;
@@ -825,12 +825,12 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
isWhiteSpace(
const XMLCh* const ch,
- int start,
- int length)
+ unsigned int start,
+ unsigned int length)
{
- const int end = start + length;
+ const unsigned int end = start + length;
- for(int s = start; s < end; s++)
+ for(unsigned int s = start; s < end; s++)
{
if (!isSpace(ch[s]))
return false;
@@ -841,7 +841,7 @@
-XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(std::string)
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(string)
DOMStringToStdString(const DOMString& domString)
{
XMLCh* toTranscode = domString.rawBuffer();
@@ -851,7 +851,7 @@
// Short circuit if its a null pointer
if (!toTranscode || (!toTranscode[0]))
{
- return std::string();
+ return string();
}
// See if our XMLCh and wchar_t as the same on this platform
@@ -878,7 +878,10 @@
// same, we have to use a temp buffer. Since this is common in these
// samples, we just do it anyway.
//
- wchar_t* tmpSource = new wchar_t[realLen + 1];
+ wchar_t* const tmpSource = new wchar_t[realLen + 1];
+
+ ArrayJanitor<wchar_t> tmpSourceJanitor(tmpSource);
+
if (isSameSize)
{
memcpy(tmpSource, toTranscode, realLen * sizeof(wchar_t));
@@ -894,7 +897,9 @@
const unsigned int targetLen = ::wcstombs(0, tmpSource, 0);
// Allocate out storage member
- char *localForm = new char[targetLen + 1];
+ char* const localForm = new char[targetLen + 1];
+
+ ArrayJanitor<char> localFormJanitor(localForm);
//
// And transcode our temp source buffer to the local buffer. Cap it
@@ -903,12 +908,6 @@
//
::wcstombs(localForm, tmpSource, targetLen);
localForm[targetLen] = 0;
-
- std::string ret(localForm);
-
- // Don't forget to delete our temp buffers
- delete [] tmpSource;
- delete [] localForm;
- return ret;
+ return localForm;
}
1.7 +47 -87 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMStringHelper.hpp 2000/02/04 19:07:47 1.6
+++ DOMStringHelper.hpp 2000/02/17 20:27:26 1.7
@@ -65,21 +65,19 @@
#include <cassert>
-#include <cctype>
-#include <cstdio>
#include <functional>
#include <iosfwd>
+#include <limits>
#include <vector>
#include <string>
#include <dom/DOMString.hpp>
-#include <util/XMLString.hpp>
-class TextOutputStream;
+class TextOutputStream;
@@ -145,7 +143,7 @@
-inline int
+inline unsigned int
length(const DOMString& theString)
{
return theString.length();
@@ -153,7 +151,7 @@
-inline int
+inline unsigned int
length(const XMLCh* theBuffer)
{
assert(theBuffer != 0);
@@ -173,16 +171,7 @@
inline bool
isEmpty(const DOMString& str)
{
-#if defined(__GNUC__)
- // @@ JMD: linux had problems with this
- DOM_NullPtr *nil = 0;
- assert( (length(str)>0 && str.operator!=(nil)) ||
- (length(str)==0 && str.operator==(nil)) );
-#else
- assert( (length(str)>0 && str!=0) || (length(str)==0 && str==0) );
-#endif
-
- return length(str) == 0;
+ return length(str) == 0 ? true : false;
}
@@ -207,7 +196,11 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(void)
OutputString(
+#if defined(XALAN_NO_NAMESPACES)
+ ostream& theStream,
+#else
std::ostream& theStream,
+#endif
const DOMString& theString);
@@ -245,7 +238,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+inline ostream&
+#else
inline std::ostream&
+#endif
operator<<(
std::ostream& theStream,
const DOMString& theString)
@@ -265,42 +262,7 @@
}
-#if 0
-@@ JMD: no longer needed, exist in base class
-inline DOMString
-operator+(
- const DOMString& theLHS,
- const DOMString& theRHS)
-{
- return DOMString(theLHS) + theRHS;
-}
-
-
-inline DOMString&
-operator+=(
- DOMString& theLHS,
- const DOMString& theRHS)
-{
- theLHS.appendData(theRHS);
-
- return theLHS;
-}
-
-
-
-inline DOMString&
-operator+=(
- DOMString& theLHS,
- XMLCh theRHS)
-{
- theLHS += DOMString(&theRHS, 1);
- return theLHS;
-}
-#endif // 0
-
-
-
inline bool
isSpace(XMLCh theChar)
{
@@ -312,7 +274,7 @@
inline XMLCh
charAt(
const DOMString& theString,
- int theIndex)
+ unsigned int theIndex)
{
return theString.charAt(theIndex);
}
@@ -338,10 +300,10 @@
inline DOMString
substring(
const DOMString& theString,
- int theStartIndex,
- int theEndIndex =
-1)
+ unsigned int theStartIndex,
+ unsigned int theEndIndex = UINT_MAX)
{
- const int theStringLength = length(theString);
+ const unsigned int theStringLength = length(theString);
// $$$ ToDo: In Java-land, any failing of these
// assertions would result in an exception being thrown.
@@ -354,7 +316,7 @@
}
else
{
- const int theLength = theEndIndex == -1 ? theStringLength
- theStartIndex :
+ const unsigned int theLength = theEndIndex == UINT_MAX ?
theStringLength - theStartIndex :
theEndIndex - theStartIndex;
assert(theStartIndex + theLength <= theStringLength);
@@ -524,27 +486,18 @@
inline void
-clear(
- DOMString& theString,
- int theOffset = 0,
- int theLength = -1)
-{
- assert(theOffset >= 0);
- assert(theLength == -1 ||
- theLength <= length(theString) - theOffset);
-
- theString.deleteData(theOffset, theLength >= 0 ?
-
theLength :
-
length(theString) - theOffset);
+clear(DOMString& theString)
+{
+ theString.deleteData(0, length(theString));
}
inline void
setCharAt(
- DOMString& theString,
- int theIndex,
- XMLCh theChar)
+ DOMString& theString,
+ unsigned int theIndex,
+ XMLCh theChar)
{
assert(theIndex < length(theString));
@@ -556,7 +509,11 @@
// A standard vector of XMLChs
+#if defined(XALAN_NO_NAMESPACES)
+typedef vector<XMLCh> XMLCharVectorType;
+#else
typedef std::vector<XMLCh> XMLCharVectorType;
+#endif
@@ -583,7 +540,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct c_wstr_functor : public unary_function<DOMString, const XMLCh*>
+#else
struct c_wstr_functor : public std::unary_function<DOMString, const XMLCh*>
+#endif
{
result_type
operator() (const argument_type& theString) const
@@ -595,7 +556,11 @@
// Hash functor for DOMStrings
+#if defined(XALAN_NO_NAMESPACES)
+struct DOMStringHashFunction : public unary_function<const DOMString&,
size_t>
+#else
struct DOMStringHashFunction : public std::unary_function<const DOMString&,
size_t>
+#endif
{
result_type
operator() (argument_type theKey) const
@@ -621,7 +586,12 @@
// Equals functor for DOMStrings
+// Hash functor for DOMStrings
+#if defined(XALAN_NO_NAMESPACES)
+struct DOMStringEqualsFunction : public binary_function<const DOMString&,
const DOMString&, bool>
+#else
struct DOMStringEqualsFunction : public std::binary_function<const
DOMString&, const DOMString&, bool>
+#endif
{
result_type
operator() (first_argument_type theLHS,
@@ -633,24 +603,14 @@
+#if defined(XALAN_NO_NAMESPACES)
+XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(string)
+#else
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(std::string)
+#endif
DOMStringToStdString(const DOMString& domString);
-#if defined(__GNUC__)
-
-// Linux GNU C++ doesn't support wstring
-#else
-
-inline std::wstring
-DOMStringToStdWString(const DOMString& domString)
-{
- return (c_wstr(domString));
-}
-
-#endif
-
-
//Is the string just whitespace?
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
@@ -661,8 +621,8 @@
XALAN_PLATFORMSUPPORT_EXPORT_FUNCTION(bool)
isWhiteSpace(
const XMLCh* ch,
- int start,
- int length);
+ unsigned int start,
+ unsigned int length);
1.2 +12 -10 xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.cpp
Index: DOMStringPrintWriter.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMStringPrintWriter.cpp 1999/12/18 19:47:49 1.1
+++ DOMStringPrintWriter.cpp 2000/02/17 20:27:26 1.2
@@ -110,8 +110,8 @@
void
DOMStringPrintWriter::write(
const char* s,
- long theOffset,
- long theLength)
+ unsigned int theOffset,
+ unsigned int theLength)
{
write(DOMString(s), theOffset, theLength);
}
@@ -121,11 +121,13 @@
void
DOMStringPrintWriter::write(
const XMLCh* s,
- long theOffset,
- long theLength)
+ unsigned int theOffset,
+ unsigned int theLength)
{
+#if !defined(XALAN_NO_NAMESPACES)
using std::vector;
using std::copy;
+#endif
assert(s != 0);
assert(theOffset >= 0);
@@ -165,8 +167,8 @@
void
DOMStringPrintWriter::write(
const DOMString& s,
- long theOffset,
- long theLength)
+ unsigned int theOffset,
+ unsigned int theLength)
{
assert(s != 0);
assert(theOffset >= 0);
@@ -211,7 +213,7 @@
void
DOMStringPrintWriter::print(
const char* s,
- long theLength)
+ unsigned int theLength)
{
write(s,
0,
@@ -223,7 +225,7 @@
void
DOMStringPrintWriter::print(
const XMLCh* s,
- long theLength)
+ unsigned int theLength)
{
write(s,
0,
@@ -295,7 +297,7 @@
void
DOMStringPrintWriter::println(
const char* s,
- long theLength)
+ unsigned int theLength)
{
print(s, theLength);
@@ -307,7 +309,7 @@
void
DOMStringPrintWriter::println(
const XMLCh* s,
- long theLength)
+ unsigned int theLength)
{
print(s, theLength);
1.2 +17 -13 xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.hpp
Index: DOMStringPrintWriter.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringPrintWriter.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMStringPrintWriter.hpp 1999/12/18 19:47:49 1.1
+++ DOMStringPrintWriter.hpp 2000/02/17 20:27:26 1.2
@@ -64,6 +64,10 @@
+#include <limits>
+
+
+
#include <PlatformSupport/PrintWriter.hpp>
@@ -103,26 +107,26 @@
// Output functions
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const char* s,
- long theOffset = 0,
- long theLength = -1);
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX);
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const XMLCh* s,
- long theOffset = 0,
- long theLength = -1);
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX);
virtual void
write(XMLCh c);
- // If the length is -1, then the entire string is printed.
+ // If the length is UINT_MAX, then the entire string is printed.
virtual void
write(const DOMString& s,
- long theOffset = 0,
- long theLength = -1);
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX);
virtual void
print(bool b);
@@ -132,11 +136,11 @@
virtual void
print(const char* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
print(const XMLCh* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
print(double d);
@@ -161,11 +165,11 @@
virtual void
println(const char* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
println(const XMLCh* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
println(double d);
1.5 +0 -4 xml-xalan/c/src/PlatformSupport/DecimalFormatSymbols.cpp
Index: DecimalFormatSymbols.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DecimalFormatSymbols.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DecimalFormatSymbols.cpp 2000/01/28 14:59:21 1.4
+++ DecimalFormatSymbols.cpp 2000/02/17 20:27:26 1.5
@@ -63,11 +63,7 @@
static XMLCh theInfinityDefault[] = { 0x221E, 0 };
-#if defined(__GNUC__)
DecimalFormatSymbols::DecimalFormatSymbols() :
-#else
-DecimalFormatSymbols::DecimalFormatSymbols(const std::locale& /*
theLocale */) :
-#endif
m_currencySymbol("$"),
m_decimalSeparator('.'),
m_digit(0),
1.3 +4 -12 xml-xalan/c/src/PlatformSupport/DecimalFormatSymbols.hpp
Index: DecimalFormatSymbols.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DecimalFormatSymbols.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DecimalFormatSymbols.hpp 2000/01/28 14:59:21 1.2
+++ DecimalFormatSymbols.hpp 2000/02/17 20:27:26 1.3
@@ -64,13 +64,6 @@
-#if defined(__GNUC__)
-// This doesn't exist in g++ yet
-#else
-#include <locale>
-#endif
-
-
#include <dom/DOMString.hpp>
@@ -79,12 +72,11 @@
{
public:
-#if defined(__GNUC__)
- DecimalFormatSymbols();
-#else
+ // Eventually, this constructor should take a locale to determine
+ // all of the stuff it needs to know. But locales are implemented
+ // on all of our platforms yet.
explicit
- DecimalFormatSymbols(const std::locale& theLocale = std::locale());
-#endif
+ DecimalFormatSymbols();
DecimalFormatSymbols(const DecimalFormatSymbols& theSource);
1.3 +63 -85 xml-xalan/c/src/PlatformSupport/DirectoryEnumerator.hpp
Index: DirectoryEnumerator.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DirectoryEnumerator.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DirectoryEnumerator.hpp 2000/01/28 14:59:22 1.2
+++ DirectoryEnumerator.hpp 2000/02/17 20:27:26 1.3
@@ -66,14 +66,14 @@
#if defined(_MSC_VER)
#include <io.h>
-#else
-# if defined(__GNUC__)
+#elif defined(__GNUC__)
#include <dirent.h>
-# else
-# error Unsupport platform!!!
-# endif
+#else
+#error Unsupported platform!!!
#endif
+
+
#include <functional>
#include <iterator>
#include <vector>
@@ -89,7 +89,6 @@
#if defined(_MSC_VER)
-
class FindFileStruct : public _wfinddata_t
{
public:
@@ -103,58 +102,15 @@
eReadOnly = _A_RDONLY,
eSystem = _A_SYSTEM
};
-
- const XMLCh*
- getName() const
- {
- return name;
- }
-
- bool
- isArchive() const
- {
- return attrib & eAttributeArchive ? true : false;
- }
-
- bool
- isDirectory() const
- {
- return attrib & eAttributeDirectory ? true : false;
- }
- bool
- isHidden() const
- {
- return attrib & eAttributeHidden ? true : false;
- }
+#elif defined(__GNUC__)
- bool
- isNormal() const
- {
- return attrib == eAttributeNormal ? true : false;
- }
-
- bool
- isReadOnly() const
- {
- return attrib & eReadOnly ? true : false;
- }
-
- bool
- isSystem() const
- {
- return attrib & eSystem ? true : false;
- }
-};
-
-#else
-# if defined(__GNUC__)
-
class FindFileStruct
{
+public:
+
XMLCh m_name[MAXNAMLEN];
int m_attrib;
-public:
enum eAttributes
{
@@ -166,57 +122,60 @@
eSystem = 32
};
+#else
+#error Unsupported platform!!!
+#endif
+
const XMLCh*
getName() const
{
- return m_name;
+ return name;
}
bool
isArchive() const
{
- return m_attrib & eAttributeArchive ? true : false;
+ return attrib & eAttributeArchive ? true : false;
}
bool
isDirectory() const
{
- return m_attrib & eAttributeDirectory ? true : false;
+ return attrib & eAttributeDirectory ? true : false;
}
bool
isHidden() const
{
- return m_attrib & eAttributeHidden ? true : false;
+ return attrib & eAttributeHidden ? true : false;
}
bool
isNormal() const
{
- return m_attrib == eAttributeNormal ? true : false;
+ return attrib == eAttributeNormal ? true : false;
}
bool
isReadOnly() const
{
- return m_attrib & eReadOnly ? true : false;
+ return attrib & eReadOnly ? true : false;
}
bool
isSystem() const
{
- return m_attrib & eSystem ? true : false;
+ return attrib & eSystem ? true : false;
}
};
-# else
-# error Unsupported platform!
-# endif
-#endif
-
+#if defined(XALAN_NO_NAMESPACES)
+struct ArchiveFileFilterPredicate : public unary_function<FindFileStruct,
bool>
+#else
struct ArchiveFileFilterPredicate : public
std::unary_function<FindFileStruct, bool>
+#endif
{
result_type
operator()(const argument_type& theFindData) const
@@ -227,7 +186,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct DirectoryFilterPredicate : public unary_function<FindFileStruct, bool>
+#else
struct DirectoryFilterPredicate : public std::unary_function<FindFileStruct,
bool>
+#endif
{
result_type
operator()(const argument_type& theFindData) const
@@ -238,7 +201,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct HiddenFileFilterPredicate : public unary_function<FindFileStruct,
bool>
+#else
struct HiddenFileFilterPredicate : public
std::unary_function<FindFileStruct, bool>
+#endif
{
result_type
operator()(const argument_type& theFindData) const
@@ -249,7 +216,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct NormalFileFilterPredicate : public unary_function<FindFileStruct,
bool>
+#else
struct NormalFileFilterPredicate : public
std::unary_function<FindFileStruct, bool>
+#endif
{
result_type
operator()(const argument_type& theFindData) const
@@ -260,7 +231,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct ReadOnlyFileFilterPredicate : public unary_function<FindFileStruct,
bool>
+#else
struct ReadOnlyFileFilterPredicate : public
std::unary_function<FindFileStruct, bool>
+#endif
{
result_type
operator()(const argument_type& theFindData) const
@@ -271,7 +246,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct SystemFileFilterPredicate : public unary_function<FindFileStruct,
bool>
+#else
struct SystemFileFilterPredicate : public
std::unary_function<FindFileStruct, bool>
+#endif
{
result_type
operator()(const argument_type& theFindData) const
@@ -282,26 +261,26 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct FilesOnlyFilterPredicate : public unary_function<FindFileStruct, bool>
+#else
struct FilesOnlyFilterPredicate : public std::unary_function<FindFileStruct,
bool>
+#endif
{
result_type
operator()(const argument_type& theFindData) const
{
- DirectoryFilterPredicate
directoryfilterpredicate;
- ArchiveFileFilterPredicate archivefilefilterpredicate;
- NormalFileFilterPredicate normalfilefilterpredicate;
- ReadOnlyFileFilterPredicate readonlyfilefilterpredicate;
- return !directoryfilterpredicate(theFindData) &&
- (archivefilefilterpredicate(theFindData) ||
- normalfilefilterpredicate(theFindData) ||
- readonlyfilefilterpredicate(theFindData));
+ DirectoryFilterPredicate theDirectoryPredicate;
+ ArchiveFileFilterPredicate theArchivePredicate;
+ NormalFileFilterPredicate theNormalPredicate;
+ ReadOnlyFileFilterPredicate theReadOnlyPredicate;
+
+ return !theDirectoryPredicate(theFindData) &&
+ (theArchivePredicate(theFindData) ||
+ theNormalPredicate(theFindData) ||
+ theReadOnlyPredicate(theFindData));
}
-
-// DirectoryFilterPredicate m_directoryPredicate;
-// ArchiveFileFilterPredicate m_archivePredicate;
-// NormalFileFilterPredicate m_normalPredicate;
-// ReadOnlyFileFilterPredicate m_readOnlyPredicate;
};
@@ -350,15 +329,10 @@
_findclose(theSearchHandle);
}
+#elif defined(__GNUC__)
+ assert(false);
#else
-
-# if defined(__GNUC__)
- // @@ Need to implement this !!
- assert(0);
-# else
-# error Unsupport platform!!!
-# endif
-
+#error Unsupported platform!!!
#endif
}
@@ -368,7 +342,11 @@
class FilterPredicateType = FilesOnlyFilterPredicate,
class StringType = DOMString,
class StringConversionFunction = c_wstr_functor>
+#if defined(XALAN_NO_NAMESPACES)
+struct DirectoryEnumeratorFunctor : public unary_function<StringType,
CollectionType>
+#else
struct DirectoryEnumeratorFunctor : public std::unary_function<StringType,
CollectionType>
+#endif
{
result_type
operator()(const argument_type& theDirectory) const
1.3 +14 -8 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DoubleSupport.cpp 2000/01/28 14:59:22 1.2
+++ DoubleSupport.cpp 2000/02/17 20:27:26 1.3
@@ -57,37 +57,43 @@
#include "DoubleSupport.hpp"
+#if defined(NO_STD_LIMITS)
#if defined(__GNUC__)
#include <math.h>
// @@ JMD: Shouldn't need this as well ??
#include <bits/nan.h>
+else
+#error Unsupported platform!!!
+#endif
#else
#include <limits>
#endif
-
-
-#if defined(_MSC_VER)
-const double DoubleSupport::s_NaN =
std::numeric_limits<double>::quiet_NaN();
-const double DoubleSupport::s_positiveInfinity =
std::numeric_limits<double>::infinity();
-const double DoubleSupport::s_negativeInfinity =
std::numeric_limits<double>::signaling_NaN();
-#else
+#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!
+#error Unsupported platform!!!
#endif
+#else
+const double DoubleSupport::s_NaN = std::numeric_limits<double>::quiet_NaN();
+const double DoubleSupport::s_positiveInfinity =
std::numeric_limits<double>::infinity();
+const double DoubleSupport::s_negativeInfinity =
std::numeric_limits<double>::signaling_NaN();
#endif
#if defined(XALAN_NEED_SPECIAL_NAN_SUPPORT)
const unsigned long* DoubleSupport::s_NaNFirstDWORD =
+#if defined(XALAN_OLD_STYLE_CASTS)
+ (const unsigned long*)&s_NaN;
+#else
reinterpret_cast<const unsigned
long*>(&s_NaN);
+#endif
const unsigned long* DoubleSupport::s_NaNSecondDWORD =
s_NaNFirstDWORD + 1;
1.2 +4 -0 xml-xalan/c/src/PlatformSupport/Factory.hpp
Index: Factory.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/Factory.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Factory.hpp 1999/12/18 19:47:49 1.1
+++ Factory.hpp 2000/02/17 20:27:26 1.2
@@ -127,7 +127,11 @@
+#if defined(XALAN_NO_NAMESPACES)
+struct DeleteFactoryObjectFunctor : public unary_function<const
FactoryObject*, void>
+#else
struct DeleteFactoryObjectFunctor : public std::unary_function<const
FactoryObject*, void>
+#endif
{
public:
1.6 +32 -20
xml-xalan/c/src/PlatformSupport/NamedNodeMapAttributeList.cpp
Index: NamedNodeMapAttributeList.cpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/PlatformSupport/NamedNodeMapAttributeList.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- NamedNodeMapAttributeList.cpp 2000/01/26 20:30:14 1.5
+++ NamedNodeMapAttributeList.cpp 2000/02/17 20:27:26 1.6
@@ -54,12 +54,14 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
-#include "NamedNodeMapAttributeList.hpp"
+#include "NamedNodeMapAttributeList.hpp"
#include <dom/DOM_Attr.hpp>
#include <util/Janitor.hpp>
+#include <util/XMLString.hpp>
+
#include "DOMStringHelper.hpp"
@@ -96,12 +98,11 @@
// DOM classes return strings by value, so we have to get
// the value from the node and store the DOMString somewhere
// safe, so we have a vector of DOMStrings to hold everything.
- const DOM_Node theNode = m_nodeMap.item(m_lastIndex - index);
-
- const DOM_Attr& theAttr =
- static_cast<const DOM_Attr&>(theNode);
-
- m_cachedData.push_back(theAttr.getName());
+#if defined(XALAN_OLD_STYLE_CASTS)
+ m_cachedData.push_back(((const
DOM_Attr&)((DOM_NamedNodeMap&)m_nodeMap).item(m_lastIndex - index)).getName());
+#else
+ m_cachedData.push_back(static_cast<const
DOM_Attr&>(const_cast<DOM_NamedNodeMap&>(m_nodeMap).item(m_lastIndex -
index)).getName());
+#endif
return c_wstr(m_cachedData.back());
}
@@ -128,13 +129,12 @@
// DOM classes return strings by value, so we have to get
// the value from the node and store the DOMString somewhere
// safe, so we have a vector of DOMStrings to hold everything.
- const DOM_Node theNode = m_nodeMap.item(m_lastIndex - index);
+#if defined(XALAN_OLD_STYLE_CASTS)
+ m_cachedData.push_back(((const
DOM_Attr&)((DOM_NamedNodeMap&)m_nodeMap).item(m_lastIndex - index)).getValue());
+#else
+ m_cachedData.push_back(static_cast<const
DOM_Attr&>(const_cast<DOM_NamedNodeMap&>(m_nodeMap).item(m_lastIndex -
index)).getValue());
+#endif
- const DOM_Attr& theAttr =
- static_cast<const DOM_Attr&>(theNode);
-
- m_cachedData.push_back(theAttr.getValue());
-
return c_wstr(m_cachedData.back());
}
@@ -155,14 +155,26 @@
// DOM classes return strings by value, so we have to get
// the value from the node and store the DOMString somewhere
// safe, so we have a vector of DOMStrings to hold everything.
- const DOM_Node theNode = m_nodeMap.getNamedItem(name);
-
- const DOM_Attr& theAttr =
- static_cast<const DOM_Attr&>(theNode);
+#if defined(XALAN_OLD_STYLE_CASTS)
+ const DOM_Node theNode =
((DOM_NamedNodeMap&)m_nodeMap).getNamedItem(name);
+#else
+ const DOM_Node theNode =
const_cast<DOM_NamedNodeMap&>(m_nodeMap).getNamedItem(name);
+#endif
+
+ if (theNode == 0)
+ {
+ return 0;
+ }
+ else
+ {
+#if defined(XALAN_OLD_STYLE_CASTS)
+ m_cachedData.push_back(((const DOM_Attr&)theNode).getValue());
+#else
+ m_cachedData.push_back(static_cast<const
DOM_Attr&>(theNode).getValue());
+#endif
- m_cachedData.push_back(theAttr.getValue());
-
- return c_wstr(m_cachedData.back());
+ return c_wstr(m_cachedData.back());
+ }
}
1.2 +16 -2
xml-xalan/c/src/PlatformSupport/NamedNodeMapAttributeList.hpp
Index: NamedNodeMapAttributeList.hpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/PlatformSupport/NamedNodeMapAttributeList.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NamedNodeMapAttributeList.hpp 1999/12/18 19:47:49 1.1
+++ NamedNodeMapAttributeList.hpp 2000/02/17 20:27:26 1.2
@@ -109,11 +109,25 @@
private:
- mutable DOM_NamedNodeMap m_nodeMap;
+ // Not implemented...
+ NamedNodeMapAttributeList&
+ operator=(const NamedNodeMapAttributeList&);
+ bool
+ operator==(const NamedNodeMapAttributeList&);
+
+ // Data members...
+ const DOM_NamedNodeMap m_nodeMap;
+
const int m_lastIndex;
+
+#if defined(XALAN_NO_NAMESPACES)
+ typedef vector<DOMString> CacheType;
+#else
+ typedef std::vector<DOMString> CacheType;
+#endif
- mutable std::vector<DOMString> m_cachedData;
+ mutable CacheType m_cachedData;
};
1.2 +10 -10 xml-xalan/c/src/PlatformSupport/NullPrintWriter.cpp
Index: NullPrintWriter.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/NullPrintWriter.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NullPrintWriter.cpp 1999/12/18 19:47:50 1.1
+++ NullPrintWriter.cpp 2000/02/17 20:27:26 1.2
@@ -97,8 +97,8 @@
void
NullPrintWriter::write(
const char* /* s */,
- long /* theOffset */,
- long /* theLength */)
+ unsigned int /* theOffset */,
+ unsigned int /* theLength */)
{
}
@@ -107,8 +107,8 @@
void
NullPrintWriter::write(
const XMLCh* /* s */,
- long /* theOffset */,
- long /* theLength */)
+ unsigned int /* theOffset */,
+ unsigned int /* theLength */)
{
}
@@ -124,8 +124,8 @@
void
NullPrintWriter::write(
const DOMString& /* s */,
- long /* theOffset */,
- long /* theLength */)
+ unsigned int /* theOffset */,
+ unsigned int /* theLength */)
{
}
@@ -147,7 +147,7 @@
void
NullPrintWriter::print(
const char* /* s */,
- long /* theLength */)
+ unsigned int /* theLength */)
{
}
@@ -156,7 +156,7 @@
void
NullPrintWriter::print(
const XMLCh* /* s */,
- long /* theLength */)
+ unsigned int /* theLength */)
{
}
@@ -214,7 +214,7 @@
void
NullPrintWriter::println(
const char* /* s */,
- long /* theLength */)
+ unsigned int /* theLength */)
{
}
@@ -223,7 +223,7 @@
void
NullPrintWriter::println(
const XMLCh* /* s */,
- long /* theLength */)
+ unsigned int /* theLength */)
{
}
1.2 +13 -13 xml-xalan/c/src/PlatformSupport/NullPrintWriter.hpp
Index: NullPrintWriter.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/NullPrintWriter.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NullPrintWriter.hpp 1999/12/18 19:47:50 1.1
+++ NullPrintWriter.hpp 2000/02/17 20:27:26 1.2
@@ -90,26 +90,26 @@
virtual void
flush();
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const char* s,
- long theOffset = 0,
- long theLength = -1);
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX);
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const XMLCh* s,
- long theOffset = 0,
- long theLength = -1);
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX);
virtual void
write(XMLCh c);
- // If the length is -1, then the entire string is printed.
+ // If the length is UINT_MAX, then the entire string is printed.
virtual void
write(const DOMString& s,
- long theOffset = 0,
- long theLength = -1);
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX);
virtual void
print(bool b);
@@ -119,11 +119,11 @@
virtual void
print(const char* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
print(const XMLCh* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
print(double d);
@@ -148,11 +148,11 @@
virtual void
println(const char* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
println(const XMLCh* s,
- long theLength = -1);
+ unsigned int theLength = UINT_MAX);
virtual void
println(double x);
1.2 +3 -3 xml-xalan/c/src/PlatformSupport/NumberFormat.cpp
Index: NumberFormat.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/NumberFormat.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NumberFormat.cpp 1999/12/18 19:47:50 1.1
+++ NumberFormat.cpp 2000/02/17 20:27:26 1.2
@@ -121,19 +121,19 @@
int bufsize = len + len/m_groupingSize + 1;
XMLCh* buffer = new XMLCh[bufsize];
- XMLCh c;
+
XMLCh* p = buffer + bufsize -1;
*p-- = 0; // null terminate
for (int i= 0, ix = len-1; i < len; i++, ix--)
{
- XMLCh c = charAt(value, ix);
+ const XMLCh c = charAt(value, ix);
if (i && !(i% m_groupingSize))
{
// Could be a multiple character separator??
for (int j= m_groupingSeparator.length()-1; j>=0; j--)
*p-- = charAt(m_groupingSeparator, j);
}
- *p-- = charAt(value, ix);
+ *p-- = c;
}
DOMString s(++p);
delete [] buffer;
1.2 +13 -13 xml-xalan/c/src/PlatformSupport/PrintWriter.hpp
Index: PrintWriter.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/PrintWriter.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PrintWriter.hpp 1999/12/18 19:47:50 1.1
+++ PrintWriter.hpp 2000/02/17 20:27:26 1.2
@@ -97,26 +97,26 @@
// Output functions inherited from Writer...
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const char* s,
- long theOffset = 0,
- long theLength = -1) = 0;
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX) = 0;
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const XMLCh* s,
- long theOffset = 0,
- long theLength = -1) = 0;
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX) = 0;
virtual void
write(XMLCh c) = 0;
- // If the length is -1, then the entire string is printed.
+ // If the length is UINT_MAX, then the entire string is printed.
virtual void
write(const DOMString& s,
- long theOffset = 0,
- long theLength = -1) = 0;
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX) = 0;
// Output functions which are new...
@@ -128,11 +128,11 @@
virtual void
print(const char* s,
- long theLength = -1) = 0;
+ unsigned int theLength = UINT_MAX) = 0;
virtual void
print(const XMLCh* s,
- long theLength = -1) = 0;
+ unsigned int theLength = UINT_MAX) = 0;
virtual void
print(double d) = 0;
@@ -157,11 +157,11 @@
virtual void
println(const char* s,
- long theLength = -1) = 0;
+ unsigned int theLength = UINT_MAX) = 0;
virtual void
println(const XMLCh* s,
- long theLength = -1) = 0;
+ unsigned int theLength = UINT_MAX) = 0;
virtual void
println(double x) = 0;
1.3 +30 -0 xml-xalan/c/src/PlatformSupport/STLHelper.hpp
Index: STLHelper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/STLHelper.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- STLHelper.hpp 2000/01/28 14:59:22 1.2
+++ STLHelper.hpp 2000/02/17 20:27:26 1.3
@@ -69,7 +69,11 @@
template <class T>
+#if defined(XALAN_NO_NAMESPACES)
+struct DeleteFunctor : public unary_function<const T*, void>
+#else
struct DeleteFunctor : public std::unary_function<const T*, void>
+#endif
{
result_type
operator()(argument_type thePointer) const
@@ -82,7 +86,11 @@
#if ! defined(__GNUC__)
template <class PairType>
+#if defined(XALAN_NO_NAMESPACES)
+struct select1st : public unary_function<PairType, PairType::first_type>
+#else
struct select1st : public std::unary_function<PairType, PairType::first_type>
+#endif
{
typedef PairType value_type;
@@ -96,7 +104,11 @@
template <class PairType>
+#if defined(XALAN_NO_NAMESPACES)
+struct select2nd : public unary_function<PairType, PairType::second_type>
+#else
struct select2nd : public std::unary_function<PairType,
PairType::second_type>
+#endif
{
typedef PairType value_type;
@@ -113,8 +125,14 @@
template <class OutputIteratorType, class PairMemberSelectType>
struct PairIsolatorOutputIterator
{
+#if defined(XALAN_NO_NAMESPACES)
+ typedef output_iterator_tag
iterator_category;
+#else
typedef std::output_iterator_tag
iterator_category;
+#endif
+
typedef typename PairMemberSelectType::value_type value_type;
+
typedef void
difference_type;
typedef void
pointer;
typedef void
reference;
@@ -165,7 +183,11 @@
template <class T>
+#if defined(XALAN_NO_NAMESPACES)
+struct MapValueDeleteFunctor : public unary_function<const T::value_type&,
void>
+#else
struct MapValueDeleteFunctor : public std::unary_function<const typename
T::value_type&, void>
+#endif
{
result_type
operator()(argument_type thePair)
@@ -177,7 +199,11 @@
template<class T, class Functor>
+#if defined(XALAN_NO_NAMESPACES)
+struct nested_for_each_functor : public unary_function<const T::value_type&,
Functor>
+#else
struct nested_for_each_functor : public std::unary_function<const typename
T::value_type&, Functor>
+#endif
{
nested_for_each_functor(Functor theFunctor) :
m_functor(theFunctor)
@@ -221,7 +247,11 @@
// points. Using this algorithm instead of the default will allow the map to
// work as expected.
template<class T>
+#if defined(XALAN_NO_NAMESPACES)
+struct less_null_terminated_arrays : public binary_function<const T*, const
T*, bool>
+#else
struct less_null_terminated_arrays : public std::binary_function<const T*,
const T*, bool>
+#endif
{
result_type
operator()(first_argument_type theLHS,
1.2 +13 -9 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Writer.hpp 1999/12/18 19:47:50 1.1
+++ Writer.hpp 2000/02/17 20:27:26 1.2
@@ -64,6 +64,10 @@
+#include <limits>
+
+
+
#include <util/XML4CDefs.hpp>
@@ -90,26 +94,26 @@
// Output functions
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const char* s,
- long theOffset = 0,
- long theLength = -1) = 0;
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX) = 0;
- // If the length is -1, then the array is assumed to be null-terminated.
+ // If the length is UINT_MAX, then the array is assumed to be
null-terminated.
virtual void
write(const XMLCh* s,
- long theOffset = 0,
- long theLength = -1) = 0;
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX) = 0;
virtual void
write(XMLCh c) = 0;
- // If the length is -1, then the entire string is printed.
+ // If the length is UINT_MAX, then the entire string is printed.
virtual void
write(const DOMString& s,
- long theOffset = 0,
- long theLength = -1) = 0;
+ unsigned int theOffset = 0,
+ unsigned int theLength = UINT_MAX) = 0;
private: