Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
+52 -41
View File
@@ -1,21 +1,11 @@
//
//
// $Id: dirobj.h,v 1.2 1999/05/21 20:20:38 japost Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef dirobj_h
#define dirobj_h
/*
* NIST Utils Class Library
* clutils/dirobj.h
* May 1995
* April 1997
* David Sauder
* K. C. Morris
@@ -23,7 +13,7 @@
* and is not subject to copyright.
*/
/* */
/* $Id: dirobj.h,v 1.4 2000/06/08 17:18:10 gcosmo Exp $ */
#ifdef __O3DB__
#include <OpenOODB.h>
@@ -31,7 +21,7 @@
/*
* DirObj - This object contains a List of files in a directory.
* DirObj - This object contains a list of files in a directory.
* Can be used for interpreting a tilde, checking paths etc.
* based on InterViews FBDirectory
* Copyright (c) 1987, 1988, 1989 Stanford University from
@@ -53,35 +43,55 @@
///////////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
//#include "/proj/pdevel/autoc/arch.sunCC.iv/scl_cf.h"
// This is an scl configuration file generated by the configure script
// generated using gnu's autoconf
#include <scl_cf.h>
#ifdef HAVE_UNISTD_H
// needed at least for getuid()
#include <unistd.h>
#endif
////extern _G_uid_t getuid _G_ARGS((void));
//#ifdef HAVE_STAT_H
//#include <stat.h>
//#endif
#ifdef HAVE_SYSENT_H
#include <sysent.h>
#endif
#ifdef WIN32
# include <sys/Stat.h>
# ifndef MAXNAMLEN
# define MAXNAMLEN 255
# endif
#else
# include <stat.h>
# include <unistd.h>
#endif
#ifdef __OBJECTCENTER__
#include <sysent.h> // needed to declare getuid()
#include <sys/stat.h>
// extern int getuid();
#endif
#ifdef __GNUC__
#include <unistd.h> // needed to declare getuid() with new GNU 2.3.3
//extern _G_uid_t getuid _G_ARGS((void));
#include <stat.h>
#endif
#ifdef __SUNCPLUSPLUS__
#include <sysent.h>
// sys/stat.h is apparently needed for ObjectCenter and Sun C++ ?
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
//#ifdef __GNUC__
//#include <unistd.h> // needed to declare getuid() with new GNU 2.3.3
////extern _G_uid_t getuid _G_ARGS((void));
//#include <stat.h>
//#else
////#ifdef __OBJECTCENTER__
////#ifdef __SUNCPLUSPLUS__
////#ifdef __xlC__
//#include <sysent.h>
//#include <sys/stat.h>
//#endif
#ifndef WIN32
# include <pwd.h>
#endif
//#include <InterViews/Std/os/auth.h>
///#include <InterViews/Std/os/auth.h>
//#include <InterViews/Std/os/fs.h>
// the below is good for g++
// if getting it from /usr/include change to __string_h
@@ -98,9 +108,10 @@
#endif
//#include <InterViews/Std/sys/dir.h>
//#include <InterViews/Std/sys/stat.h>
#include "dir.h"
#include "globals.hh"
//typedef unsigned boolean;
#include <scldir.h>
typedef unsigned boolean;
#ifndef nil
#define nil 0
@@ -113,17 +124,17 @@ public:
DirObj(const char* dirName);
virtual ~DirObj();
HepBoolean LoadDirectory(const char*);
boolean LoadDirectory(const char*);
const char* Normalize(const char*);
const char* ValidDirectories(const char*);
int Index(const char*);
const char* File(int index);
// check for file in the currently loaded directory
HepBoolean FileExists(const char* file) { return Index(file) ? true : false;};
boolean FileExists(const char* file) { return Index(file) ? 1 : 0;};
int Count();
HepBoolean IsADirectory(const char*);
boolean IsADirectory(const char*);
private:
const char* Home(const char* x = nil);
const char* ElimDot(const char*);
@@ -133,7 +144,7 @@ private:
const char* ExpandTilde(const char*, int);
const char* RealPath(const char*);
HepBoolean Reset(const char*);
boolean Reset(const char*);
void ClearFileList();
void CheckIndex(int index);
void InsertFile(const char*, int index);
@@ -191,10 +202,10 @@ inline const char* DirObj::File (int index) {
//
///////////////////////////////////////////////////////////////////////////////
inline HepBoolean DotSlash (const char* path) {
inline boolean DotSlash (const char* path) {
return
path[0] != '\0' && path[0] == '.' &&
(path[1] == '/' || path[1] == '\0')? true : false;
(path[1] == '/' || path[1] == '\0');
}
//////////////////////////////// DotDotSlash() ////////////////////////////////
@@ -204,11 +215,11 @@ inline HepBoolean DotSlash (const char* path) {
//
///////////////////////////////////////////////////////////////////////////////
inline HepBoolean DotDotSlash (const char* path) {
inline boolean DotDotSlash (const char* path) {
return
path[0] != '\0' && path[1] != '\0' &&
path[0] == '.' && path[1] == '.' &&
(path[2] == '/' || path[2] == '\0')? true : false;
(path[2] == '/' || path[2] == '\0');
}
#endif