dbertoni 2003/12/31 13:41:04
Modified: c/src/xalanc/PlatformSupport DirectoryEnumerator.hpp
Log:
Reverted to 1.3.
Revision Changes Path
1.5 +29 -31
xml-xalan/c/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp
Index: DirectoryEnumerator.hpp
===================================================================
RCS file:
/home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DirectoryEnumerator.hpp 31 Dec 2003 19:11:21 -0000 1.4
+++ DirectoryEnumerator.hpp 31 Dec 2003 21:41:04 -0000 1.5
@@ -72,7 +72,6 @@
-#include <cstring>
#include <functional>
#include <iterator>
@@ -156,7 +155,7 @@
}
};
-#elif defined(XALAN_POSIX2_AVAILABLE)
+#else
struct FindFileStruct : public dirent
{
@@ -177,37 +176,33 @@
*
* @return true if file is a directory
*/
- bool isDirectory(const char* theParentPath) const
+ bool isDirectory() const
{
- bool fIsDir = false;
-
- char theBuffer[5000];
-
- getcwd(theBuffer, sizeof(theBuffer) / sizeof(theBuffer[0]) - 1);
-
- strcat(theBuffer, "/");
- strcat(theBuffer, getName());
-
- if (chdir(theBuffer) == 0)
+#if defined(AIX) || defined(HPUX) || defined(SOLARIS) || defined(OS390) ||
defined(OS400) || defined(TRU64)
+ return false;
+#else
+ if (d_type == DT_DIR || d_type == DT_UNKNOWN)
{
-#if defined(XALAN_STRICT_ANSI_HEADERS)
- using std::strrchr;
-#endif
-
- *strrchr(theBuffer, '/') = '\0';
-
- chdir(theBuffer);
-
- fIsDir = true;
+ return true;
}
-
- return fIsDir;
+ else
+ {
+ return false;
+ }
+#endif
}
bool
isSelfOrParent() const
{
- if (d_name[0] == '.')
+#if defined(AIX) || defined(HPUX) || defined(SOLARIS) || defined(OS390) ||
defined(OS400) || defined(TRU64)
+ return false;
+#else
+ if (isDirectory() == false)
+ {
+ return false;
+ }
+ else if (d_name[0] == '.')
{
if (d_name[1] == '\0')
{
@@ -223,13 +218,14 @@
return false;
}
}
-
- return false;
+ else
+ {
+ return false;
+ }
+#endif
}
};
-#else
- #error Unsupported platform!
#endif
@@ -261,6 +257,7 @@
DirectoryFilterPredicate theDirectoryPredicate;
return !theDirectoryPredicate(theFindData);
+
}
};
@@ -314,7 +311,7 @@
}
-#elif defined(XALAN_POSIX2_AVAILABLE)
+#elif defined(LINUX)
CharVectorType theTargetVector;
@@ -370,7 +367,8 @@
}
}
#else
- #error Unsupported platform!
+ // Do nothing for now...
+ // Unsupported platform!!!
#endif
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]