dbertoni 2002/12/18 09:22:06
Modified: c/Tests/PerfT perft.cpp
Log:
Changes for C++ namespaces support.
Revision Changes Path
1.18 +36 -17 xml-xalan/c/Tests/PerfT/perft.cpp
Index: perft.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/PerfT/perft.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- perft.cpp 27 Nov 2002 22:36:29 -0000 1.17
+++ perft.cpp 18 Dec 2002 17:22:05 -0000 1.18
@@ -54,19 +54,22 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
+// Base header file. Must be first.
+#include <Include/PlatformDefinitions.hpp>
+
+
+#include <cstdio>
#include <ctime>
+
+#if defined(XALAN_CLASSIC_IOSTREAMS)
+#include <iostream.h>
+#else
#include <iostream>
-#include <strstream>
-#include <stdio.h>
-#include <direct.h>
-
-#if !defined(XALAN_NO_NAMESPACES)
- using std::cerr;
- using std::cout;
- using std::endl;
#endif
+
+
#include <xercesc/util/PlatformUtils.hpp>
#include <PlatformSupport/DOMStringHelper.hpp>
@@ -77,11 +80,6 @@
#include <Harness/FileUtility.hpp>
#include <Harness/HarnessInit.hpp>
-#if defined(XALAN_NO_NAMESPACES)
- typedef map<XalanDOMString, XalanDOMString, less<XalanDOMString> >
Hashtable;
-#else
- typedef std::map<XalanDOMString, XalanDOMString> Hashtable;
-#endif
// This is here for memory leak testing.
#if !defined(NDEBUG) && defined(_MSC_VER)
@@ -90,6 +88,12 @@
+XALAN_USING_STD(cerr)
+XALAN_USING_STD(cout)
+XALAN_USING_STD(endl)
+
+
+
const char* const excludeStylesheets[] =
{
"large-evans_large.xsl",
@@ -97,12 +101,14 @@
};
+
+
inline bool
-checkForExclusion(XalanDOMString currentFile)
+checkForExclusion(const XALAN_CPP_NAMESPACE_QUALIFIER XalanDOMString&
currentFile)
{
for (int i=0; excludeStylesheets[i] != 0; i++)
{
- if (equals(currentFile, XalanDOMString(excludeStylesheets[i])))
+ if (currentFile == XALAN_CPP_NAMESPACE_QUALIFIER
XalanDOMString(excludeStylesheets[i]))
{
return true;
}
@@ -130,8 +136,9 @@
}
+
void
-setHelp(FileUtility& h)
+setHelp(XALAN_CPP_NAMESPACE_QUALIFIER FileUtility& h)
{
h.args.getHelpStream() << endl
<< "Perft dir [-out -sub -i -iter]"
@@ -156,6 +163,10 @@
int argc,
const char* argv[])
{
+ // Just hoist everything...
+ XALAN_CPP_NAMESPACE_USE
+
+
HarnessInit xmlPlatformUtils;
FileUtility h;
@@ -167,7 +178,6 @@
bool setGold = false;
const XalanDOMString
processorType(XALAN_STATIC_UCODE_STRING("XalanC"));
- bool skip = true; // Default will skip long tests
if (h.getParams(argc, argv, "PERFT-RESULTS", setGold) == true)
{
@@ -187,6 +197,9 @@
// Get the list of sub-directories below "base" and iterate
through them
bool foundDir = false; // Flag indicates directory
found. Used in conjunction with -sub cmd-line arg.
+
+ typedef FileUtility::FileNameVectorType
FileNameVectorType;
+
const FileNameVectorType dirs =
h.getDirectoryNames(h.args.base);
for(FileNameVectorType::size_type j = 0; j < dirs.size();
j++)
@@ -217,6 +230,9 @@
clock_t startTime, endTime, accmTime, avgEtoe;
double timeinMilliseconds = 0, theAverage =0;
int transformResult = 0;
+
+ typedef XMLFileReporter::Hashtable
Hashtable;
+
Hashtable attrs;
attrs.insert(Hashtable::value_type(XalanDOMString("idref"), files[i]));
@@ -406,6 +422,9 @@
try
{
+ XALAN_USING_XERCES(XMLPlatformUtils)
+ XALAN_USING_XALAN(XalanTransformer)
+
// Call the static initializers for xerces and xalan, and
create a transformer
//
XMLPlatformUtils::Initialize();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]