Import Geant4 1.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:34:16 +02:00
parent ca1c8cb059
commit 103bda00c8
2654 changed files with 29719 additions and 20203 deletions
+17 -21
View File
@@ -5,8 +5,8 @@
//
// $Id: Enumeration.cc,v 1.2 1999/05/21 20:20:47 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: Enumeration.cc,v 1.3 1999/12/15 14:50:16 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include <Enumeration.h>
@@ -26,11 +26,7 @@
//static char rcsid[] ="";
#ifdef WIN32
# include <Strstrea.h>
#else
# include <strstream.h>
#endif
#include "g4std/strstream"
// Josh L, 3/31/95
// These constants have to be initialized outside the SDAI struct. They
@@ -103,7 +99,7 @@ int Boolean::operator ==( LOGICAL log ) const
/******************************************************************
** Procedure: DebugDisplay
** Parameters: ostream& out
** Parameters: G4std::ostream& out
** Returns:
** Description: prints out some information on the enumerated
** item for debugging purposes
@@ -111,7 +107,7 @@ int Boolean::operator ==( LOGICAL log ) const
** Status: ok 2/1/91
******************************************************************/
void
STEPenumeration::DebugDisplay (ostream& out) const {
STEPenumeration::DebugDisplay (G4std::ostream& out) const {
SCLstring tmp;
out << "Value : " << v << " "
<< asStr (tmp)
@@ -142,7 +138,7 @@ STEPenumeration::DebugDisplay (ostream& out) const {
// true or false => non-matching delimiters are flagged as an error
Severity
STEPenumeration::ReadEnum(istream& in, ErrorDescriptor *err, int AssignVal,
STEPenumeration::ReadEnum(G4std::istream& in, ErrorDescriptor *err, int AssignVal,
int needDelims)
{
if(AssignVal)
@@ -155,7 +151,7 @@ STEPenumeration::ReadEnum(istream& in, ErrorDescriptor *err, int AssignVal,
int validDelimiters = 1;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
if( in.good() )
{
@@ -272,7 +268,7 @@ STEPenumeration::ReadEnum(istream& in, ErrorDescriptor *err, int AssignVal,
err->AppendToUserMsg(messageBuf);
}
}
else // Hit eof (assuming there was no error state for istream passed in)
else // Hit eof (assuming there was no error state for G4std::istream passed in)
{
err->GreaterSeverity(SEVERITY_INCOMPLETE);
}
@@ -291,7 +287,7 @@ STEPenumeration::StrToVal (const char * s)
Severity
STEPenumeration::StrToVal (const char * s, ErrorDescriptor *err, int optional)
{
istrstream in ((char *)s); // sz defaults to length of s
G4std::istrstream in ((char *)s); // sz defaults to length of s
Severity sev = ReadEnum(in, err, 1, 0);
if( (err->severity() == SEVERITY_INCOMPLETE) && optional)
@@ -304,13 +300,13 @@ STEPenumeration::StrToVal (const char * s, ErrorDescriptor *err, int optional)
Severity
STEPenumeration::STEPread (const char *s, ErrorDescriptor *err, int optional)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return STEPread (in, err, optional);
}
// reads an enumerated value in STEP file format
Severity
STEPenumeration::STEPread (istream& in, ErrorDescriptor *err, int optional)
STEPenumeration::STEPread (G4std::istream& in, ErrorDescriptor *err, int optional)
{
Severity sev = ReadEnum(in, err, 1, 1);
if( (err->severity() == SEVERITY_INCOMPLETE) && optional)
@@ -332,7 +328,7 @@ STEPenumeration::asStr (SCLstring &s) const {
}
void
STEPenumeration::STEPwrite (ostream& out) const {
STEPenumeration::STEPwrite (G4std::ostream& out) const {
if( is_null() )
out << '$';
else
@@ -379,14 +375,14 @@ STEPenumeration::set_elements (const char * const e []) {
}
#endif
Severity
STEPenumeration::EnumValidLevel(istream &in, ErrorDescriptor *err,
STEPenumeration::EnumValidLevel(G4std::istream &in, ErrorDescriptor *err,
int optional, char *tokenList,
int needDelims, int clearError)
{
if(clearError)
err->ClearErrorMsg();
in >> ws; // skip white space
in >> G4std::ws; // skip white space
char c = ' ';
c = in.peek();
if(c == '$' || in.eof())
@@ -423,7 +419,7 @@ STEPenumeration::EnumValidLevel(const char *value, ErrorDescriptor *err,
int optional, char *tokenList,
int needDelims, int clearError)
{
istrstream in((char *)value);
G4std::istrstream in((char *)value);
return EnumValidLevel (in, err, optional, tokenList, needDelims,
clearError);
/*
@@ -551,7 +547,7 @@ STEPenumeration::operator= (const STEPenumeration& Senum)
return *this;
}
ostream &operator<< ( ostream& out, const STEPenumeration& a )
G4std::ostream &operator<< ( G4std::ostream& out, const STEPenumeration& a )
{
SCLstring tmp;
out << a.asStr( tmp );
@@ -628,7 +624,7 @@ STEPenumeration::StrToVal (const char * s, ErrorDescriptor *err, int optional)
Severity
STEPenumeration::STEPread (istream& in, ErrorDescriptor *err, int optional)
STEPenumeration::STEPread (G4std::istream& in, ErrorDescriptor *err, int optional)
{
char enumValue [BUFSIZ];
char c;
+4 -4
View File
@@ -5,8 +5,8 @@
//
// $Id: ExpDict.cc,v 1.2 1999/05/21 20:20:47 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: ExpDict.cc,v 1.3 1999/12/15 14:50:16 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -335,13 +335,13 @@ EntityDescriptor::FindLongestAttribute()
while( attrPtr != 0)
{
if(attrPtr->AttrDesc()->IsEntityType())
maxAttrLen = max(maxAttrLen,
maxAttrLen = G4std::max(maxAttrLen,
(strlen(attrPtr->AttrDesc()->EntityType()->Name()) +
strlen(attrPtr->AttrDesc()->Name()) + 3
)
);
else
maxAttrLen = max(maxAttrLen,
maxAttrLen = G4std::max(maxAttrLen,
(strlen(attrPtr->AttrDesc()->DomainType()->NameOrDescription()) +
strlen(attrPtr->AttrDesc()->Name()) + 3
)
@@ -6,7 +6,7 @@
//
// $Id: ExpDict_inline.cc,v 1.2 1999/05/21 20:20:48 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -6,7 +6,7 @@
//
// $Id: Registry_inline.cc,v 1.2 1999/05/21 20:20:48 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -5,8 +5,8 @@
//
// $Id: STEPaggregate.cc,v 1.2 1999/05/21 20:20:48 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPaggregate.cc,v 1.3 1999/12/15 14:50:16 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -80,7 +80,7 @@ STEPaggregate::AggrValidLevel(const char *value, ErrorDescriptor *err,
if(clearError)
err->ClearErrorMsg();
istrstream in ((char *)value); // sz defaults to length of s
G4std::istrstream in ((char *)value); // sz defaults to length of s
ReadValue(in, err, elem_type, insts, addFileId, 0, 0);
CheckRemainingInput(in, err, elem_type->AttrTypeName(), tokenList);
@@ -91,7 +91,7 @@ STEPaggregate::AggrValidLevel(const char *value, ErrorDescriptor *err,
// require exchange file format
Severity
STEPaggregate::AggrValidLevel(istream &in, ErrorDescriptor *err,
STEPaggregate::AggrValidLevel(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type, InstMgr *insts,
int optional, char *tokenList, int addFileId,
int clearError)
@@ -109,7 +109,7 @@ STEPaggregate::AggrValidLevel(istream &in, ErrorDescriptor *err,
// if exchangeFileFormat == 1 then paren delims are required.
Severity
STEPaggregate::ReadValue(istream &in, ErrorDescriptor *err,
STEPaggregate::ReadValue(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId,
int assignVal, int exchangeFileFormat)
@@ -124,7 +124,7 @@ STEPaggregate::ReadValue(istream &in, ErrorDescriptor *err,
char c;
int validDelims = 1;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
c = in.peek(); // does not advance input
@@ -184,7 +184,7 @@ STEPaggregate::ReadValue(istream &in, ErrorDescriptor *err,
if(assignVal) // pass the node to STEPaggregate
AddNode (item);
in >> ws; // skip white space (although should already be skipped)
in >> G4std::ws; // skip white space (although should already be skipped)
in.get(c); // read delim
// CheckRemainingInput should have left the input right at the delim
@@ -222,14 +222,14 @@ STEPaggregate::StrToVal(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type, InstMgr *insts,
int addFileId)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return ReadValue(in, err, elem_type, insts, addFileId, 1, 0);
}
///////////////////////////////////////////////////////////////////////////////
Severity
STEPaggregate::STEPread(istream& in, ErrorDescriptor *err,
STEPaggregate::STEPread(G4std::istream& in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId)
{
@@ -258,7 +258,7 @@ STEPaggregate::asStr(SCLstring & s) const
}
void
STEPaggregate::STEPwrite(ostream& out) const
STEPaggregate::STEPwrite(G4std::ostream& out) const
{
if(!_null)
{
@@ -320,7 +320,7 @@ STEPnode::StrToVal(const char *s, ErrorDescriptor *err)
}
Severity
STEPnode::StrToVal(istream &in, ErrorDescriptor *err)
STEPnode::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
// defined in subtypes
G4cerr << "Internal error: " << __FILE__ << ": " << __LINE__ << "\n" ;
@@ -352,7 +352,7 @@ STEPnode::STEPread(const char *s, ErrorDescriptor *err)
}
Severity
STEPnode::STEPread(istream &in, ErrorDescriptor *err)
STEPnode::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
G4cerr << "Internal error: " << __FILE__ << ": " << __LINE__ << "\n" ;
G4cerr << "function: STEPnode::STEPread called instead of virtual function.\n"
@@ -388,7 +388,7 @@ STEPnode::STEPwrite (SCLstring &s)
}
void
STEPnode::STEPwrite (ostream& out)
STEPnode::STEPwrite (G4std::ostream& out)
{
G4cerr << "Internal error: " << __FILE__ << ": " << __LINE__ << "\n" ;
G4cerr << "function: STEPnode::STEPwrite called instead of virtual function.\n"
@@ -463,7 +463,7 @@ GenericAggrNode::StrToVal(const char *s, ErrorDescriptor *err)
//TODO
Severity
GenericAggrNode::StrToVal(istream &in, ErrorDescriptor *err)
GenericAggrNode::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
return value.STEPread(in, err);
}
@@ -471,12 +471,12 @@ GenericAggrNode::StrToVal(istream &in, ErrorDescriptor *err)
Severity
GenericAggrNode::STEPread(const char *s, ErrorDescriptor *err)
{
istrstream in((char *) s);
G4std::istrstream in((char *) s);
return value.STEPread(in, err);
}
Severity
GenericAggrNode::STEPread(istream &in, ErrorDescriptor *err)
GenericAggrNode::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
return value.STEPread(in, err);
}
@@ -503,7 +503,7 @@ GenericAggrNode::STEPwrite(SCLstring &s)
}
void
GenericAggrNode::STEPwrite (ostream& out)
GenericAggrNode::STEPwrite (G4std::ostream& out)
{
value.STEPwrite(out);
}
@@ -525,7 +525,7 @@ EntityAggregate::~EntityAggregate ()
// if exchangeFileFormat == 1 then delims are required.
Severity
EntityAggregate::ReadValue(istream &in, ErrorDescriptor *err,
EntityAggregate::ReadValue(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId,
int assignVal, int exchangeFileFormat)
@@ -540,7 +540,7 @@ EntityAggregate::ReadValue(istream &in, ErrorDescriptor *err,
char c;
int validDelims = 1;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
c = in.peek(); // does not advance input
@@ -599,7 +599,7 @@ EntityAggregate::ReadValue(istream &in, ErrorDescriptor *err,
if(assignVal)
AddNode (item);
in >> ws; // skip white space (although should already be skipped)
in >> G4std::ws; // skip white space (although should already be skipped)
in.get(c); // read delim
// CheckRemainingInput should have left the input right at the delim
@@ -698,7 +698,7 @@ EntityNode::StrToVal(const char *s, ErrorDescriptor *err,
}
Severity
EntityNode::StrToVal(istream &in, ErrorDescriptor *err,
EntityNode::StrToVal(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId)
{
@@ -710,12 +710,12 @@ EntityNode::STEPread(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return STEPread(in, err, elem_type, insts, addFileId);
}
Severity
EntityNode::STEPread(istream &in, ErrorDescriptor *err,
EntityNode::STEPread(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId)
{
@@ -767,7 +767,7 @@ EntityNode::STEPwrite(SCLstring &s)
}
void
EntityNode::STEPwrite(ostream& out)
EntityNode::STEPwrite(G4std::ostream& out)
{
if (!node || (node == S_ENTITY_NULL)) // nothing
out << "$";
@@ -793,7 +793,7 @@ SelectAggregate::~SelectAggregate ()
// if exchangeFileFormat == 1 then delims are required.
Severity
SelectAggregate::ReadValue(istream &in, ErrorDescriptor *err,
SelectAggregate::ReadValue(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId,
int assignVal, int exchangeFileFormat)
@@ -808,7 +808,7 @@ SelectAggregate::ReadValue(istream &in, ErrorDescriptor *err,
char c;
int validDelims = 1;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
c = in.peek(); // does not advance input
@@ -869,7 +869,7 @@ SelectAggregate::ReadValue(istream &in, ErrorDescriptor *err,
if(assignVal)
AddNode (item);
in >> ws; // skip white space (although should already be skipped)
in >> G4std::ws; // skip white space (although should already be skipped)
in.get(c); // read delim
// CheckRemainingInput should have left the input right at the delim
@@ -945,14 +945,14 @@ SelectNode::StrToVal(const char *s, ErrorDescriptor *err,
node = S_ENTITY_NULL;
*/
// KC you will have to decide what to do here
istrstream in((char*)s);
G4std::istrstream in((char*)s);
if (err->severity( node->STEPread(in, err, insts) ) != SEVERITY_NULL)
err->AppendToDetailMsg (node ->Error ());
return err->severity();
}
Severity
SelectNode::StrToVal(istream &in, ErrorDescriptor *err,
SelectNode::StrToVal(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId)
{
@@ -964,12 +964,12 @@ SelectNode::STEPread(const char *s, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return STEPread(in, err, elem_type, insts, addFileId);
}
Severity
SelectNode::STEPread(istream &in, ErrorDescriptor *err,
SelectNode::STEPread(G4std::istream &in, ErrorDescriptor *err,
const TypeDescriptor *elem_type,
InstMgr *insts, int addFileId)
{
@@ -1011,7 +1011,7 @@ SelectNode::STEPwrite(SCLstring &s)
}
void
SelectNode::STEPwrite(ostream& out)
SelectNode::STEPwrite(G4std::ostream& out)
{
if ( !node || (node->is_null()) ) // nothing
out << "$";
@@ -1098,7 +1098,7 @@ StringNode::StrToVal(const char *s, ErrorDescriptor *err)
// this function assumes you will check for garbage following input
Severity
StringNode::StrToVal(istream &in, ErrorDescriptor *err)
StringNode::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
return value.STEPread(in, err);
}
@@ -1108,7 +1108,7 @@ StringNode::StrToVal(istream &in, ErrorDescriptor *err)
Severity
StringNode::STEPread(const char *s, ErrorDescriptor *err)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
value.STEPread(in, err);
CheckRemainingInput(in, err, "string", ",)");
@@ -1118,7 +1118,7 @@ StringNode::STEPread(const char *s, ErrorDescriptor *err)
// this function assumes you will check for garbage following input
Severity
StringNode::STEPread(istream &in, ErrorDescriptor *err)
StringNode::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
return value.STEPread(in, err);
}
@@ -1140,7 +1140,7 @@ StringNode::STEPwrite (SCLstring &s)
}
void
StringNode::STEPwrite (ostream& out)
StringNode::STEPwrite (G4std::ostream& out)
{
value.STEPwrite(out);
}
@@ -1216,7 +1216,7 @@ BinaryNode::StrToVal(const char *s, ErrorDescriptor *err)
// this function assumes you will check for garbage following input
Severity
BinaryNode::StrToVal(istream &in, ErrorDescriptor *err)
BinaryNode::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
return value.STEPread(in, err);
}
@@ -1227,7 +1227,7 @@ BinaryNode::StrToVal(istream &in, ErrorDescriptor *err)
Severity
BinaryNode::STEPread(const char *s, ErrorDescriptor *err)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
value.STEPread(in, err);
CheckRemainingInput(in, err, "binary", ",)");
@@ -1237,7 +1237,7 @@ BinaryNode::STEPread(const char *s, ErrorDescriptor *err)
// this function assumes you will check for garbage following input
Severity
BinaryNode::STEPread(istream &in, ErrorDescriptor *err)
BinaryNode::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
return value.STEPread(in, err);
}
@@ -1257,7 +1257,7 @@ BinaryNode::STEPwrite (SCLstring &s)
}
void
BinaryNode::STEPwrite (ostream& out)
BinaryNode::STEPwrite (G4std::ostream& out)
{
value.STEPwrite(out);
}
@@ -1421,7 +1421,7 @@ EnumNode::StrToVal(const char *s, ErrorDescriptor *err)
// this function assumes you will check for garbage following input
Severity
EnumNode::StrToVal(istream &in, ErrorDescriptor *err)
EnumNode::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
return node->STEPread(in, err);
}
@@ -1432,7 +1432,7 @@ EnumNode::StrToVal(istream &in, ErrorDescriptor *err)
Severity
EnumNode::STEPread(const char *s, ErrorDescriptor *err)
{
istrstream in((char *)s); // sz defaults to length of s
G4std::istrstream in((char *)s); // sz defaults to length of s
int nullable = 0;
node->STEPread (in, err, nullable);
@@ -1443,7 +1443,7 @@ EnumNode::STEPread(const char *s, ErrorDescriptor *err)
// this function assumes you will check for garbage following input
Severity
EnumNode::STEPread(istream &in, ErrorDescriptor *err)
EnumNode::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
int nullable = 0;
node->STEPread (in, err, nullable);
@@ -1483,7 +1483,7 @@ EnumNode::STEPwrite (SCLstring &s)
}
void
EnumNode::STEPwrite (ostream& out)
EnumNode::STEPwrite (G4std::ostream& out)
{
// out << '.' << asStr() << '.';
node->STEPwrite(out);
@@ -1599,7 +1599,7 @@ RealNode::StrToVal(const char *s, ErrorDescriptor *err)
}
Severity
RealNode::StrToVal(istream &in, ErrorDescriptor *err)
RealNode::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
if( ReadReal(value, in, err, ",)") ) // returns true if value is assigned
_null = 0;
@@ -1626,7 +1626,7 @@ RealNode::STEPread(const char *s, ErrorDescriptor *err)
}
Severity
RealNode::STEPread(istream &in, ErrorDescriptor *err)
RealNode::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
if( ReadReal(value, in, err, ",)") ) // returns true if value is assigned
_null = 0;
@@ -1661,7 +1661,7 @@ RealNode::STEPwrite(SCLstring &s)
}
void
RealNode::STEPwrite(ostream& out)
RealNode::STEPwrite(G4std::ostream& out)
{
SCLstring s;
out << STEPwrite(s);
@@ -1691,7 +1691,7 @@ IntNode::StrToVal(const char *s, ErrorDescriptor *err)
}
Severity
IntNode::StrToVal(istream &in, ErrorDescriptor *err)
IntNode::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
if( ReadInteger(value, in, err, ",)") )// returns true if value is assigned
_null = 0;
@@ -1717,7 +1717,7 @@ IntNode::STEPread(const char *s, ErrorDescriptor *err)
}
Severity
IntNode::STEPread(istream &in, ErrorDescriptor *err)
IntNode::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
if( ReadInteger(value, in, err, ",)") ) // returns true if value is assigned
_null = 0;
@@ -1751,7 +1751,7 @@ IntNode::STEPwrite(SCLstring &s)
}
void
IntNode::STEPwrite(ostream& out)
IntNode::STEPwrite(G4std::ostream& out)
{
SCLstring s;
out << STEPwrite(s);
@@ -5,8 +5,8 @@
//
// $Id: STEPattribute.cc,v 1.2 1999/05/21 20:20:49 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPattribute.cc,v 1.4 1999/12/15 18:04:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
* NIST STEP Core Class Library
@@ -23,6 +23,11 @@
//static char rcsid[] ="";
#ifndef G4USE_STD_NAMESPACE
#ifndef WIN32
#include <stream.h>
#endif
#endif
#include <read_func.h>
#include <STEPattribute.h>
@@ -113,7 +118,7 @@ STEPattribute::StrToVal (const char* s, InstMgr * instances, int addFileId)
return _error.severity (SEVERITY_INPUT_ERROR);
}
istrstream in ((char *)s); // sz defaults to length of s
G4std::istrstream in ((char *)s); // sz defaults to length of s
int valAssigned = 0;
// read in value for attribute
@@ -202,7 +207,7 @@ STEPattribute::StrToVal (const char* s, InstMgr * instances, int addFileId)
** Returns: Severity, which indicates success, or failure
** value >= SEVERITY_WARNING means program can continue parsing input,
** value <= SEVERITY_INPUT_ERROR is fatal read error
** Description: the value of the attribute is read from istream
** Description: the value of the attribute is read from G4std::istream
** the format expected is STEP exchange file
** modified to accept '$' as value for OPTIONAL ATTRIBUTE,
** (since this function is used for reading files in both
@@ -213,7 +218,7 @@ STEPattribute::StrToVal (const char* s, InstMgr * instances, int addFileId)
// the delim separating the last attribute from the end of the entity (')').
Severity
STEPattribute::STEPread (istream& in, InstMgr * instances, int addFileId)
STEPattribute::STEPread (G4std::istream& in, InstMgr * instances, int addFileId)
{
char errStr[BUFSIZ];
@@ -225,7 +230,7 @@ STEPattribute::STEPread (istream& in, InstMgr * instances, int addFileId)
// set the value to be null (reinitialize the attribute value)
set_null();
in >> ws; // skip whitespace
in >> G4std::ws; // skip whitespace
in >> c;
in.putback (c); // leave input stream alone
@@ -253,7 +258,7 @@ STEPattribute::STEPread (istream& in, InstMgr * instances, int addFileId)
return _error.severity();
case '*':
in.get(c); // take * off the istream
in.get(c); // take * off the G4std::istream
if (IsDerived ())
_error.severity(SEVERITY_NULL);
else {
@@ -470,7 +475,7 @@ STEPattribute::asStr (SCLstring& str) const
// The output is in physical file format.
void
STEPattribute::STEPwrite (ostream& out)
STEPattribute::STEPwrite (G4std::ostream& out)
{
if (IsDerived ()) {
out << "*";
@@ -504,11 +509,10 @@ STEPattribute::STEPwrite (ostream& out)
// style output used below should shift such things to e-notation
// automagically.
#ifndef WIN32
out << form("%.*g", (int) Real_Num_Precision,tmp);
#else
out << (int) Real_Num_Precision << " " << tmp;
#endif
char* outBuf="";
sprintf(outBuf, "%.*G", (int) Real_Num_Precision,tmp);
out << outBuf;
break;
}
@@ -938,13 +942,13 @@ STEPattribute::ValidLevel (const char *attrValue, ErrorDescriptor *error,
/******************************************************************
** Procedure: operator <<
** Parameters: ostream & out -- output stream
** Parameters: G4std::ostream & out -- output stream
** STEPattribute & a -- attribute to output
** Returns: ostream &
** Returns: G4std::ostream &
** Description: overloads the output operator to Print an attribute
******************************************************************/
ostream &operator<< ( ostream& out, STEPattribute& a )
G4std::ostream &operator<< ( G4std::ostream& out, STEPattribute& a )
{
a.STEPwrite (out);
return out;
@@ -991,10 +995,16 @@ STEPattribute::AddErrorInfo()
// if it hits one of StopChars it puts it back.
// RETURNS: the last char it read.
char
STEPattribute::SkipBadAttr(istream& in, char *StopChars)
STEPattribute::SkipBadAttr(G4std::istream& in, char *StopChars)
{
#ifndef WIN32
int sk = in.skip(0); //turn skipping whitespace off
// turn skipping whitespace off
#ifdef G4USE_STD_NAMESPACE
in.unsetf(G4std::ios::skipws);
#else
#ifndef WIN32
int sk = in.skip(0);
#endif
#endif
// read bad data until end of this attribute or entity.
@@ -1022,9 +1032,16 @@ STEPattribute::SkipBadAttr(istream& in, char *StopChars)
_error.AppendToDetailMsg(errStr);
}
in.putback (c);
#ifndef WIN32
in.skip(sk); //set skip whitespace to its original state
// set skip whitespace to its original state
#ifdef G4USE_STD_NAMESPACE
in.setf(G4std::ios::skipws);
#else
#ifndef WIN32
in.skip(sk);
#endif
#endif
return c;
}
@@ -6,7 +6,7 @@
//
// $Id: STEPattributeList.cc,v 1.2 1999/05/21 20:20:49 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -6,7 +6,7 @@
//
// $Id: STEPattribute_inline.cc,v 1.2 1999/05/21 20:20:49 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
+24 -24
View File
@@ -5,8 +5,8 @@
//
// $Id: STEPcomplex.cc,v 1.2 1999/05/21 20:20:50 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPcomplex.cc,v 1.3 1999/12/15 14:50:16 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#include <ctype.h>
@@ -14,7 +14,7 @@
#include <STEPcomplex.h>
extern const char *
ReadStdKeyword(istream& in, SCLstring &buf, int skipInitWS);
ReadStdKeyword(G4std::istream& in, SCLstring &buf, int skipInitWS);
STEPcomplex::STEPcomplex(Registry *registry, int fileid)
@@ -183,7 +183,7 @@ STEPcomplex::AddEntityPart(const char *name)
}
else
{
G4cout << scomplex->_error.DetailMsg() << endl;
G4cout << scomplex->_error.DetailMsg() << G4endl;
delete scomplex;
}
}
@@ -237,7 +237,7 @@ STEPcomplex::AppendEntity(STEPcomplex *stepc)
// READ
Severity
STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
istream& in)
G4std::istream& in)
{
char c;
SCLstring typeNm;
@@ -253,18 +253,18 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
stepc = stepc->sc;
}
in >> ws;
in >> G4std::ws;
in.get(c);
if(c == '(') // opening paren for subsuperRecord
{
in >> ws;
in >> G4std::ws;
c = in.peek();
while(c != ')')
{
typeNm.set_null();
in >> ws;
in >> G4std::ws;
ReadStdKeyword(in, typeNm, 1); // read the type name
in >> ws;
in >> G4std::ws;
c = in.peek();
if(c != '(')
{
@@ -287,7 +287,7 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
STEPread_error(c,0,in);
return _error.severity();
}
in >> ws;
in >> G4std::ws;
c = in.peek();
}
if(c != ')')
@@ -302,7 +302,7 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
// READ
Severity
STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
istream& in)
G4std::istream& in)
{
ClearError(1);
STEPfile_id = id;
@@ -315,12 +315,12 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
}
char c;
in >> ws;
in >> G4std::ws;
in.get(c);
if(c == '(')
{
SCLstring s;
in >> ws;
in >> G4std::ws;
in.get(c);
while( in && (c != '(') && !isspace(c) ) // get the entity name
{
@@ -329,7 +329,7 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
}
if(isspace(c))
{
in >> ws;
in >> G4std::ws;
in.get(c);
}
// STEPcomplex *EntityPart(const char *name);
@@ -346,11 +346,11 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
else // c == '('
in.putback(c);
G4cout << s.chars() << endl;
G4cout << s.chars() << G4endl;
BuildAttrs( s.chars() );
STEPentity::STEPread(id, addFileId, instance_set, in);
in >> ws;
in >> G4std::ws;
in.get(c);
while(c != ')')
{
@@ -362,7 +362,7 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
}
if(isspace(c))
{
in >> ws;
in >> G4std::ws;
in.get(c);
}
if(c != '(')
@@ -377,13 +377,13 @@ STEPcomplex::STEPread(int id, int addFileId, class InstMgr * instance_set,
else // c == '('
in.putback(c);
G4cout << s.chars() << endl; // diagnostics DAS
G4cout << s.chars() << G4endl; // diagnostics DAS
STEPcomplex *stepc = new STEPcomplex( _registry );
AppendEntity(stepc);
stepc->BuildAttrs( s.chars() );
stepc->STEPentity::STEPread(id, addFileId, instance_set, in);
in >> ws;
in >> G4std::ws;
in.get(c);
}
}
@@ -497,14 +497,14 @@ STEPcomplex::BuildAttrs(const char *s )
}
void
STEPcomplex::STEPread_error(char c, int index, istream& in)
STEPcomplex::STEPread_error(char c, int index, G4std::istream& in)
{
G4cout << "STEPcomplex::STEPread_error() \n";
}
// WRITE
void
STEPcomplex::STEPwrite(ostream& out, int writeComment)
STEPcomplex::STEPwrite(G4std::ostream& out, int writeComment)
{
if(writeComment && p21Comment && !p21Comment->is_null() )
out << p21Comment->chars();
@@ -526,11 +526,11 @@ STEPcomplex::STEPwrite(SCLstring &buf)
sprintf(instanceInfo, "#%d=", STEPfile_id );
*/
/*
strstream ss;
G4std::strstream ss;
ss << "#" << STEPfile_id << "=(";
WriteExtMapEntities(ss);
ss << ");";
ss << ends;
ss << G4std::ends;
char *tmpstr = ss.str();
buf.Append(tmpstr);
@@ -543,7 +543,7 @@ STEPcomplex::STEPwrite(SCLstring &buf)
}
void
STEPcomplex::WriteExtMapEntities(ostream& out)
STEPcomplex::WriteExtMapEntities(G4std::ostream& out)
{
SCLstring tmp;
out << StrToUpper (EntityName(), tmp);
+20 -20
View File
@@ -5,8 +5,8 @@
//
// $Id: STEPentity.cc,v 1.2 1999/05/21 20:20:50 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPentity.cc,v 1.3 1999/12/15 14:50:16 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
@@ -129,7 +129,7 @@ STEPentity::AddP21Comment(SCLstring &s, int replace)
}
void
STEPentity::STEPwrite_reference (ostream& out)
STEPentity::STEPwrite_reference (G4std::ostream& out)
{
out << "#" << STEPfile_id;
}
@@ -288,13 +288,13 @@ void STEPentity::EnforceOptionality(int on)
*/
/******************************************************************
** Procedure: beginSTEPwrite
** Parameters: ostream& out -- stream to write to
** Parameters: G4std::ostream& out -- stream to write to
** Returns:
** Side Effects: writes out the SCOPE section for an entity
** Status: stub
******************************************************************/
void STEPentity::beginSTEPwrite(ostream& out)
void STEPentity::beginSTEPwrite(G4std::ostream& out)
{
out << "begin STEPwrite ... \n" ;
out.flush();
@@ -309,7 +309,7 @@ void STEPentity::beginSTEPwrite(ostream& out)
/******************************************************************
** Procedure: STEPwrite
** Parameters: ostream& out -- stream to write to
** Parameters: G4std::ostream& out -- stream to write to
** Returns:
** Side Effects: writes out the data associated with an instance
in STEP format
@@ -317,7 +317,7 @@ void STEPentity::beginSTEPwrite(ostream& out)
**
******************************************************************/
void STEPentity::STEPwrite(ostream& out, int writeComment)
void STEPentity::STEPwrite(G4std::ostream& out, int writeComment)
{
SCLstring tmp;
if(writeComment && p21Comment && !p21Comment->is_null() )
@@ -332,7 +332,7 @@ void STEPentity::STEPwrite(ostream& out, int writeComment)
out << ");\n";
}
void STEPentity::endSTEPwrite(ostream& out)
void STEPentity::endSTEPwrite(G4std::ostream& out)
{
out << "end STEPwrite ... \n" ;
out.flush();
@@ -388,14 +388,14 @@ STEPentity::PrependEntityErrMsg()
** Procedure: STEPentity::STEPread_error
** Parameters: char c -- character which caused error
** int i -- index of attribute which caused error
** istream& in -- input stream for recovery
** G4std::istream& in -- input stream for recovery
** Returns:
** Description: reports the error found, reads until it finds the end of an
** instance. i.e. a close quote followed by a semicolon optionally having
** whitespace between them.
******************************************************************/
void
STEPentity::STEPread_error(char c, int i, istream& in)
STEPentity::STEPread_error(char c, int i, G4std::istream& in)
{
char errStr[BUFSIZ];
errStr[0] = '\0';
@@ -453,7 +453,7 @@ STEPentity::STEPread_error(char c, int i, istream& in)
}
if(in.good() && (c == ')') )
{
in >> ws; // skip whitespace
in >> G4std::ws; // skip whitespace
in.get(c);
tmp.Append(c);
// G4cerr << c;
@@ -486,13 +486,13 @@ STEPentity::STEPread_error(char c, int i, istream& in)
** Parameters: int id
** int idIncrement
** InstMgr instances
** istream& in
** G4std::istream& in
** Side Effects: gobbles up input stream
** Status:
******************************************************************/
Severity
STEPentity::STEPread(int id, int idIncr, InstMgr * instance_set, istream& in)
STEPentity::STEPread(int id, int idIncr, InstMgr * instance_set, G4std::istream& in)
{
STEPfile_id = id;
char c ='\0';
@@ -503,7 +503,7 @@ STEPentity::STEPread(int id, int idIncr, InstMgr * instance_set, istream& in)
// L. Broglia
// ClearError(1);
in >> ws;
in >> G4std::ws;
in >> c;
// read the open paren
@@ -514,7 +514,7 @@ STEPentity::STEPread(int id, int idIncr, InstMgr * instance_set, istream& in)
" Missing initial open paren... Trying to recover.\n");
in.putback(c); // assume you can recover by reading 1st attr value
}
in >> ws;
in >> G4std::ws;
int n = attributes.list_length();
if( n == 0) // no attributes
@@ -588,14 +588,14 @@ STEPentity::STEPread(int id, int idIncr, InstMgr * instance_set, istream& in)
///////////////////////////////////////////////////////////////////////////////
STEPentity *
ReadEntityRef(istream &in, ErrorDescriptor *err, char *tokenList,
ReadEntityRef(G4std::istream &in, ErrorDescriptor *err, char *tokenList,
InstMgr * instances, int addFileId)
{
char c;
char errStr[BUFSIZ];
errStr[0] = '\0';
in >> ws;
in >> G4std::ws;
in >> c;
switch (c)
{
@@ -692,7 +692,7 @@ STEPentity *
ReadEntityRef(const char * s, ErrorDescriptor *err, char *tokenList,
InstMgr * instances, int addFileId)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return ReadEntityRef(in, err, tokenList, instances, addFileId);
}
@@ -924,7 +924,7 @@ STEPentity::AttributeCount () {
#ifdef OBSOLETE
Severity
STEPentity::ReadAttrs(int id, int addFileId,
class InstMgr * instance_set, istream& in)
class InstMgr * instance_set, G4std::istream& in)
{
char c ='\0';
char errStr[BUFSIZ];
@@ -987,7 +987,7 @@ STEPentity::ReadAttrs(int id, int addFileId,
}
else if(c == ')')
{
in >> ws;
in >> G4std::ws;
char z = in.peek();
if (z == ';')
{
+81 -81
View File
@@ -1,7 +1,7 @@
// This code is utilised in the GEANT4 detector simulation toolkit.
//
// $Id: STEPfile.cc,v 1.2 1999/05/21 20:20:51 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPfile.cc,v 1.3 1999/12/15 14:50:16 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -36,7 +36,7 @@
#include <s_HEADER_SCHEMA.h>
// STEPundefined contains
// void PushPastString (istream& in, SCLstring &s, ErrorDescriptor *err)
// void PushPastString (G4std::istream& in, SCLstring &s, ErrorDescriptor *err)
#include <STEPundefined.h>
/***************************
@@ -79,21 +79,21 @@ STEPfile::SetFileName (const char* newName)
/***************************
function: ReadHeader
returns: Severity
parameters: (istream&) The input stream from which the file is read.
parameters: (G4std::istream&) The input stream from which the file is read.
description:
This function reads in the header section of an exchange file. It
can read it in either version (N279) or (Part 21, July 1992). It
parses the header section, popluates the _headerInstances, and
returns an error descriptor.
It expects to find the "HEADER;" symbol at the beginning of the
istream.
G4std::istream.
side effects: The function gobbles all characters up to and including the
next "ENDSEC;" from in.
The STEPfile::_headerInstances may change.
***************************/
Severity
STEPfile::ReadHeader (istream& in)
STEPfile::ReadHeader (G4std::istream& in)
{
SCLstring cmtStr;
@@ -129,7 +129,7 @@ STEPfile::ReadHeader (istream& in)
}
//check for user defined instances
//if it is userDefined, the '!' does not get put back on the istream
//if it is userDefined, the '!' does not get put back on the G4std::istream
in.get(c);
if (c == '!') { userDefined = 1; }
else { in.putback(c); }
@@ -201,12 +201,12 @@ STEPfile::ReadHeader (istream& in)
break;
}
//read the values from the istream
//read the values from the G4std::istream
objsev = obj->STEPread(fileid,0,(InstMgr*)0,in);
if( !cmtStr.is_null() )
obj->AddP21Comment(cmtStr);
in >> ws;
in >> G4std::ws;
c = in.peek(); // check for semicolon or keyword 'ENDSEC'
if(c != 'E')
in >> c; // read the semicolon
@@ -594,7 +594,7 @@ STEPfile::EntityWfState(char c)
// starts at the data section
int
STEPfile::ReadData1(istream& in)
STEPfile::ReadData1(G4std::istream& in)
{
int endsec = 0;
_entsNotCreated = 0;
@@ -650,7 +650,7 @@ STEPfile::ReadData1(istream& in)
tmpbuf.set_null();
FindStartOfInstance(in,tmpbuf);
G4cout << "ERROR: trying to recover from invalid data. skipping: "
<< tmpbuf.chars() << endl;
<< tmpbuf.chars() << G4endl;
in >> c;
ReadTokenSeparator(in);
}
@@ -726,7 +726,7 @@ STEPfile::ReadData1(istream& in)
#if bzpoibujqoiwejsdlfj
int
STEPfile::ReadData1(istream& in)
STEPfile::ReadData1(G4std::istream& in)
{
int endsec = 0;
_entsNotCreated = 0;
@@ -756,7 +756,7 @@ STEPfile::ReadData1(istream& in)
}
else
{
G4cout << "Invalid editing state character: " << c << endl;
G4cout << "Invalid editing state character: " << c << G4endl;
G4cout << "Assigning editing state to be INCOMPLETE\n";
inst_state = incompleteSE;
}
@@ -769,7 +769,7 @@ STEPfile::ReadData1(istream& in)
tmpbuf.set_null();
SkipInstance(in,tmpbuf);
G4cout << "ERROR: trying to recover from invalid data. skipping: "
<< tmpbuf.chars() << endl;
<< tmpbuf.chars() << G4endl;
ReadTokenSeparator(in);
}
@@ -833,7 +833,7 @@ STEPfile::ReadData1(istream& in)
}
if( !endsec && (c != ENTITY_NAME_DELIM) )
{
G4cout << "Invalid editing state character: " << c << endl;
G4cout << "Invalid editing state character: " << c << G4endl;
G4cout << "Assigning editing state to be INCOMPLETE\n";
ReadTokenSeparator(in);
in >> c; // read the ENTITY_NAME_DELIM
@@ -850,7 +850,7 @@ STEPfile::ReadData1(istream& in)
tmpbuf.set_null();
SkipInstance(in,tmpbuf);
G4cout << "ERROR: trying to recover from invalid data. skipping: "
<< tmpbuf.chars() << endl;
<< tmpbuf.chars() << G4endl;
ReadTokenSeparator(in);
}
if( c == ENTITY_NAME_DELIM )
@@ -882,7 +882,7 @@ STEPfile::ReadData1(istream& in)
#endif
int
STEPfile::ReadWorkingData1 (istream& in)
STEPfile::ReadWorkingData1 (G4std::istream& in)
{
return ReadData1(in);
@@ -940,7 +940,7 @@ STEPfile::ReadWorkingData1 (istream& in)
return instance_count;
}
in >> ws;
in >> G4std::ws;
in >> c;
if( c != ENTITY_NAME_DELIM)
{
@@ -1028,13 +1028,13 @@ STEPfile::ReadWorkingData1 (istream& in)
/******************************************************************
** Procedure: ReadData2
** Parameters: istream
** Parameters: G4std::istream
** Returns: number of valid instances read
** Description: reads in the data portion of the instances
** in an exchange file
******************************************************************/
int
STEPfile::ReadData2 (istream& in)
STEPfile::ReadData2 (G4std::istream& in)
{
_entsInvalid = 0;
_entsIncomplete = 0;
@@ -1078,7 +1078,7 @@ STEPfile::ReadData2 (istream& in)
// don't need this error msg for the 2nd pass (it was Done on 1st)
else
{
G4cout << "Invalid editing state character: " << c << endl;
G4cout << "Invalid editing state character: " << c << G4endl;
G4cout << "Assigning editing state to be INCOMPLETE\n";
inst_state = incompleteSE;
}
@@ -1095,7 +1095,7 @@ STEPfile::ReadData2 (istream& in)
tmpbuf.set_null();
FindStartOfInstance(in,tmpbuf);
G4cout << "ERROR: trying to recover from invalid data. skipping: "
<< tmpbuf.chars() << endl;
<< tmpbuf.chars() << G4endl;
in >> c;
ReadTokenSeparator( in, &cmtStr );
}
@@ -1161,7 +1161,7 @@ STEPfile::ReadData2 (istream& in)
"Second pass complete - instance summary:", total_instances,
_entsInvalid, _entsIncomplete, "Warnings",
_entsWarning);
G4cout << buf << endl;
G4cout << buf << G4endl;
_error.AppendToUserMsg(buf);
_error.AppendToDetailMsg(buf);
_error.GreaterSeverity(SEVERITY_WARNING);
@@ -1176,7 +1176,7 @@ STEPfile::ReadData2 (istream& in)
#if xpqosdblkxfnvkbybbbbb
int
STEPfile::ReadData2 (istream& in)
STEPfile::ReadData2 (G4std::istream& in)
{
_entsInvalid = 0;
_entsIncomplete = 0;
@@ -1210,7 +1210,7 @@ STEPfile::ReadData2 (istream& in)
}
else if( c != ENTITY_NAME_DELIM )
{
G4cout << "Invalid editing state character: " << c << endl;
G4cout << "Invalid editing state character: " << c << G4endl;
G4cout << "Assigning editing state to be INCOMPLETE\n";
ReadTokenSeparator( in, &cmtStr );
in >> c; // read the ENTITY_NAME_DELIM
@@ -1280,7 +1280,7 @@ STEPfile::ReadData2 (istream& in)
}
else if( c != ENTITY_NAME_DELIM )
{
G4cout << "Invalid editing state character: " << c << endl;
G4cout << "Invalid editing state character: " << c << G4endl;
G4cout << "Assigning editing state to be INCOMPLETE\n";
ReadTokenSeparator( in, &cmtStr );
in >> c; // read the ENTITY_NAME_DELIM
@@ -1292,7 +1292,7 @@ STEPfile::ReadData2 (istream& in)
tmpbuf.set_null();
SkipInstance(in,tmpbuf);
G4cout << "ERROR: trying to recover from invalid data. skipping: "
<< tmpbuf.chars() << endl;
<< tmpbuf.chars() << G4endl;
ReadTokenSeparator(in);
}
@@ -1305,7 +1305,7 @@ STEPfile::ReadData2 (istream& in)
"Reading File 2nd pass instance summary:", total_instances,
_entsInvalid, _entsIncomplete, _entsWarning,
"issued warnings");
// G4cout << buf << endl;
// G4cout << buf << G4endl;
_error.AppendToUserMsg(buf);
_error.AppendToDetailMsg(buf);
_error.GreaterSeverity(SEVERITY_WARNING);
@@ -1322,7 +1322,7 @@ STEPfile::ReadData2 (istream& in)
#ifdef junk
// old version 8/23/94
int
STEPfile::ReadData2 (istream& in)
STEPfile::ReadData2 (G4std::istream& in)
{
_errorCount = 0; // reset error count
_warningCount = 0; // reset error count
@@ -1369,7 +1369,7 @@ STEPfile::ReadData2 (istream& in)
#endif
int
STEPfile::ReadWorkingData2 (istream& in)
STEPfile::ReadWorkingData2 (G4std::istream& in)
{
return ReadData2 (in);
#ifdef junk
@@ -1452,7 +1452,7 @@ STEPfile::ReadWorkingData2 (istream& in)
*/
int
STEPfile::FindDataSection (istream& in)
STEPfile::FindDataSection (G4std::istream& in)
{
ErrorDescriptor errs;
SdaiString tmp;
@@ -1483,7 +1483,7 @@ STEPfile::FindDataSection (istream& in)
if (c == 'A')
{
in.get(c); // read 'A'
in >> ws; // may want to skip comments or Print control directives?
in >> G4std::ws; // may want to skip comments or Print control directives?
c = in.peek(); // look for semicolon
if (c == ';')
{
@@ -1516,7 +1516,7 @@ STEPfile::FindDataSection (istream& in)
}
int
STEPfile::FindHeaderSection (istream& in)
STEPfile::FindHeaderSection (G4std::istream& in)
{
char buf[BUFSIZ];
char *b = buf;
@@ -1545,23 +1545,23 @@ STEPfile::FindHeaderSection (istream& in)
/***************************
description:
This function creates an instance based on the KEYWORD
read from the istream.
read from the G4std::istream.
It expects an ENTITY_NAME (int) from the first set of
characters on the istream. If the (int) is not found,
characters on the G4std::istream. If the (int) is not found,
ENTITY_NULL is returned.
side effects:
The function leaves the istream set to the end of the stream
The function leaves the G4std::istream set to the end of the stream
of characters representing the ENTITY_INSTANCE. It attempts to
recover on errors by reading up to and including the next ';'.
an ENTITY_INSTANCE consists of:
'#'(int)'=' [SCOPE] SIMPLE_RECORD ';' ||
'#'(int)'=' [SCOPE] SUBSUPER_RECORD ';'
The '#' is read from the istream before CreateInstance is called.
The '#' is read from the G4std::istream before CreateInstance is called.
***************************/
STEPentity *
STEPfile::CreateInstance(istream& in, ostream &out)
STEPfile::CreateInstance(G4std::istream& in, G4std::ostream &out)
{
SCLstring tmpbuf;
char errbuf[BUFSIZ];
@@ -1582,7 +1582,7 @@ STEPfile::CreateInstance(istream& in, ostream &out)
{
SkipInstance(in, tmpbuf);
out << "ERROR: instance #" << fileid
<< " already exists.\n\tData lost: " << tmpbuf << endl;
<< " already exists.\n\tData lost: " << tmpbuf << G4endl;
return ENTITY_NULL;
}
@@ -1593,12 +1593,12 @@ STEPfile::CreateInstance(istream& in, ostream &out)
// ERROR: '=' expected
SkipInstance(in, tmpbuf);
out << "ERROR: instance #" << fileid
<< " \'=\' expected.\n\tData lost: " << tmpbuf << endl;
<< " \'=\' expected.\n\tData lost: " << tmpbuf << G4endl;
return ENTITY_NULL;
}
ReadTokenSeparator(in);
c = in.peek(); // peek at the next character on the istream
c = in.peek(); // peek at the next character on the G4std::istream
//check for optional "&SCOPE" Construct
if (c == '&') // TODO check this out
@@ -1607,7 +1607,7 @@ STEPfile::CreateInstance(istream& in, ostream &out)
if (s < SEVERITY_WARNING)
{ return ENTITY_NULL; }
ReadTokenSeparator(in);
c = in.peek(); // peek at next char on istream again
c = in.peek(); // peek at next char on G4std::istream again
}
//check for subtype/supertype record
@@ -1642,7 +1642,7 @@ STEPfile::CreateInstance(istream& in, ostream &out)
out << "WARNING: instance #" << fileid
<< " User Defined Entity in DATA section ignored.\n"
<< "\tData lost: \'!" << objnm.chars() << "\': " << tmpbuf
<< endl;
<< G4endl;
return ENTITY_NULL;
}
else
@@ -1677,15 +1677,15 @@ STEPfile::CreateInstance(istream& in, ostream &out)
instance to the instance manager.
side-effects:
It first searches for "&SCOPE" and reads all characters
from the istream up to and including "ENDSCOPE"
from the G4std::istream up to and including "ENDSCOPE"
returns: ErrorDescriptor
>= SEVERITY_WARNING: the istream was read up to and including the
>= SEVERITY_WARNING: the G4std::istream was read up to and including the
"ENDSCOPE" and the export List /#1, ... #N/
< SEVERITY_WARNING: the istream was read up to and including the next ";"
< SEVERITY_WARNING: the G4std::istream was read up to and including the next ";"
< SEVERITY_BUG: fatal
**************************************************/
Severity
STEPfile::CreateScopeInstances(istream& in, STEPentityH ** scopelist)
STEPfile::CreateScopeInstances(G4std::istream& in, STEPentityH ** scopelist)
{
Severity rval = SEVERITY_NULL;
STEPentity * se;
@@ -1787,7 +1787,7 @@ STEPfile::CreateScopeInstances(istream& in, STEPentityH ** scopelist)
}
STEPentity *
STEPfile::CreateSubSuperInstance(istream& in, int fileid)
STEPfile::CreateSubSuperInstance(G4std::istream& in, int fileid)
{
SCLstring tmpstr;
char errbuf[BUFSIZ];
@@ -1801,7 +1801,7 @@ STEPfile::CreateSubSuperInstance(istream& in, int fileid)
SCLstring *entNmArr[enaSize]; // array of entity type names
int enaIndex = 0;
in >> ws;
in >> G4std::ws;
in.get(c); // read the open paren
c = in.peek(); // see if you have closed paren (ending the record)
while(in.good() && (c != ')') && (enaIndex < enaSize) )
@@ -1819,7 +1819,7 @@ STEPfile::CreateSubSuperInstance(istream& in, int fileid)
buf.set_null();
enaIndex++;
}
in >> ws;
in >> G4std::ws;
c = in.peek(); // see if you have closed paren (ending the record)
// If someone separates the entities with commas (or some other
// garbage or a comment) this will keep the read function from
@@ -1848,13 +1848,13 @@ STEPfile::CreateSubSuperInstance(istream& in, int fileid)
/**************************************************
description:
This function reads the SCOPE List for an entity instance,
and reads the values for each instance from the istream.
and reads the values for each instance from the G4std::istream.
side-effects:
It first searches for "&SCOPE" and reads all characters
from the istream up to and including "ENDSCOPE"
from the G4std::istream up to and including "ENDSCOPE"
**************************************************/
Severity
STEPfile::ReadScopeInstances (istream& in)
STEPfile::ReadScopeInstances (G4std::istream& in)
{
Severity rval = SEVERITY_NULL;
STEPentity * se;
@@ -1940,7 +1940,7 @@ STEPfile::ReadScopeInstances (istream& in)
/*
Severity
STEPfile::ReadSubSuperInstance (istream& in)
STEPfile::ReadSubSuperInstance (G4std::istream& in)
{
SCLstring tmp;
SkipInstance(in, tmp);
@@ -1950,7 +1950,7 @@ STEPfile::ReadSubSuperInstance (istream& in)
#ifdef junk
void
ReadEntityError(char c, int i, istream& in)
ReadEntityError(char c, int i, G4std::istream& in)
{
char errStr[BUFSIZ];
errStr[0] = '\0';
@@ -1999,7 +1999,7 @@ ReadEntityError(char c, int i, istream& in)
}
if(in.good() && (c == ')') )
{
in >> ws; // skip whitespace
in >> G4std::ws; // skip whitespace
in.get(c);
tmp.Append(c);
// G4cerr << c;
@@ -2020,14 +2020,14 @@ ReadEntityError(char c, int i, istream& in)
/*****************************************************
description:
This function populates a STEPentity with the values read from
the istream.
the G4std::istream.
This function must keeps track of error messages encountered when
reading the STEPentity. It passes STEPentity error information onto
the STEPfile ErrorDescriptor.
*****************************************************/
STEPentity *
STEPfile::ReadInstance(istream& in, ostream& out, SCLstring &cmtStr)
STEPfile::ReadInstance(G4std::istream& in, G4std::ostream& out, SCLstring &cmtStr)
{
Severity sev = SEVERITY_NULL;
@@ -2052,7 +2052,7 @@ STEPfile::ReadInstance(istream& in, ostream& out, SCLstring &cmtStr)
{
SkipInstance(in, tmpbuf);
out << "\nERROR: in 2nd pass, instance #" << fileid
<< " not found.\n\tData lost: " << tmpbuf << endl;
<< " not found.\n\tData lost: " << tmpbuf << G4endl;
return ENTITY_NULL;
}
else if ((_fileType != WORKING_SESSION) && (node->CurrState() != newSE))
@@ -2060,7 +2060,7 @@ STEPfile::ReadInstance(istream& in, ostream& out, SCLstring &cmtStr)
SkipInstance(in, tmpbuf);
out << "\nERROR: in 2nd pass, instance #" << fileid
<< " already exists - ignoring duplicate.\n\tData lost: "
<< tmpbuf << endl;
<< tmpbuf << G4endl;
return ENTITY_NULL;
}
@@ -2072,13 +2072,13 @@ STEPfile::ReadInstance(istream& in, ostream& out, SCLstring &cmtStr)
//ERROR: '=' expected
SkipInstance(in, tmpbuf);
out << "ERROR: instance #" << fileid
<< " \'=\' expected.\n\tData lost: " << tmpbuf << endl;
<< " \'=\' expected.\n\tData lost: " << tmpbuf << G4endl;
return ENTITY_NULL;
}
ReadTokenSeparator(in, &cmtStr);
//peek at the next character on the istream
//peek at the next character on the G4std::istream
c = in.peek();
//check for optional "&SCOPE" Construct
@@ -2265,7 +2265,7 @@ STEPfile::MakeBackupFile()
/***************************
***************************/
Severity
STEPfile::WriteExchangeFile(ostream& out, int validate)
STEPfile::WriteExchangeFile(G4std::ostream& out, int validate)
{
Severity rval = SEVERITY_NULL;
SetFileType(VERSION_CURRENT);
@@ -2307,7 +2307,7 @@ STEPfile::WriteExchangeFile(const char* filename, int validate)
}
}
ostream* out = OpenOutputFile(filename);
G4std::ostream* out = OpenOutputFile(filename);
if (_error.severity() < SEVERITY_WARNING) return _error.severity();
rval = WriteExchangeFile(*out, 0);
CloseOutputFile(out);
@@ -2389,7 +2389,7 @@ STEPfile::HeaderIdOld (const char* name)
/***************************
***************************/
void
STEPfile::WriteHeader(ostream& out)
STEPfile::WriteHeader(G4std::ostream& out)
{
out << "HEADER;\n";
@@ -2414,7 +2414,7 @@ STEPfile::WriteHeader(ostream& out)
/***************************
***************************/
void
STEPfile::WriteHeaderInstance(STEPentity* obj, ostream& out)
STEPfile::WriteHeaderInstance(STEPentity* obj, G4std::ostream& out)
{
SCLstring tmp;
if(obj->P21CommentRep())
@@ -2432,7 +2432,7 @@ STEPfile::WriteHeaderInstance(STEPentity* obj, ostream& out)
/***************************
***************************/
void
STEPfile::WriteHeaderInstanceFileName (ostream& out)
STEPfile::WriteHeaderInstanceFileName (G4std::ostream& out)
{
// Get the FileName instance from _headerInstances
STEPentity* se = _headerInstances->GetSTEPentity("File_Name");
@@ -2484,7 +2484,7 @@ STEPfile::WriteHeaderInstanceFileName (ostream& out)
(STEPentity*)fn = _headerInstances->GetSTEPentity(mn);
}
// Write the values for the FileName instance to the ostream
// Write the values for the FileName instance to the G4std::ostream
SCLstring tmp;
out << StrToUpper (fn->EntityName()) << "(";
@@ -2536,7 +2536,7 @@ STEPfile::WriteHeaderInstanceFileName (ostream& out)
void
STEPfile::WriteHeaderInstanceFileDescription (ostream& out)
STEPfile::WriteHeaderInstanceFileDescription (G4std::ostream& out)
{
// Get the FileDescription instance from _headerInstances
STEPentity *se = _headerInstances->GetSTEPentity("File_Description");
@@ -2565,7 +2565,7 @@ STEPfile::WriteHeaderInstanceFileDescription (ostream& out)
{
(STEPentity*)fd = _headerInstances->GetSTEPentity(mn);
}
// Write the values for the FileDescription instance to the ostream
// Write the values for the FileDescription instance to the G4std::ostream
out << StrToUpper (fd->EntityName()) << "(";
//write description
@@ -2582,7 +2582,7 @@ STEPfile::WriteHeaderInstanceFileDescription (ostream& out)
}
void
STEPfile::WriteHeaderInstanceFileSchema (ostream& out)
STEPfile::WriteHeaderInstanceFileSchema (G4std::ostream& out)
{
// Get the FileName instance from _headerInstances
STEPentity *se = _headerInstances->GetSTEPentity("File_Schema");
@@ -2611,7 +2611,7 @@ STEPfile::WriteHeaderInstanceFileSchema (ostream& out)
{
(STEPentity*)fs = _headerInstances->GetSTEPentity(mn);
}
// Write the values for the FileName instance to the ostream
// Write the values for the FileName instance to the G4std::ostream
out << StrToUpper (fs->EntityName()) << "(";
// write schema_identifiers
@@ -2626,7 +2626,7 @@ STEPfile::WriteHeaderInstanceFileSchema (ostream& out)
***************************/
void
STEPfile::WriteData(ostream& out)
STEPfile::WriteData(G4std::ostream& out)
{
out << "DATA;\n";
@@ -2638,7 +2638,7 @@ STEPfile::WriteData(ostream& out)
}
Severity
STEPfile::AppendFile (istream* in)
STEPfile::AppendFile (G4std::istream* in)
{
Severity rval = SEVERITY_NULL;
char errbuf[BUFSIZ];
@@ -2649,7 +2649,7 @@ STEPfile::AppendFile (istream* in)
ReadTokenSeparator(*in);
SCLstring keywd = GetKeyword(*in, "; #", _error);
// get the delimiter off the istream
// get the delimiter off the G4std::istream
char c;
in->get(c);
@@ -2702,7 +2702,7 @@ STEPfile::AppendFile (istream* in)
_errorCount, _warningCount);
G4cout << errbuf;
}
else G4cout << endl;
else G4cout << G4endl;
if (!FindDataSection (*in))
{
@@ -2731,7 +2731,7 @@ STEPfile::AppendFile (istream* in)
_errorCount = 0; // reset the error count so you\'re not counting things twice
// delete in; // yikes -- deleted by caller
istream * in2;
G4std::istream * in2;
if (! ((in2 = OpenInputFile ()) && (in2 -> good ())) )
{ // if the stream is not readable, there's an error
_error.AppendToUserMsg ("Cannot open file for 2nd pass -- No data read.\n");
@@ -2793,7 +2793,7 @@ STEPfile::AppendFile (istream* in)
{
ReadTokenSeparator(*in2);
keywd = GetKeyword (*in2,";", _error);
//yank the ";" from the istream
//yank the ";" from the G4std::istream
//if (';' == in2->peek()) in2->get();
char c; in2->get(c); if (c == ';') ;
}
@@ -2816,7 +2816,7 @@ STEPfile::AppendFile (istream* in)
/***************************
***************************/
Severity
STEPfile::WriteWorkingFile(ostream& out)
STEPfile::WriteWorkingFile(G4std::ostream& out)
{
SetFileType (WORKING_SESSION);
_error.ClearErrorMsg();
@@ -2843,7 +2843,7 @@ Severity
STEPfile::WriteWorkingFile(const char* filename)
{
_error.ClearErrorMsg();
ostream* out = OpenOutputFile(filename);
G4std::ostream* out = OpenOutputFile(filename);
if (_error.severity() < SEVERITY_WARNING) return _error.severity();
Severity rval = WriteWorkingFile(*out);
CloseOutputFile(out);
@@ -2855,7 +2855,7 @@ STEPfile::WriteWorkingFile(const char* filename)
/***************************
***************************/
void
STEPfile::WriteWorkingData(ostream& out)
STEPfile::WriteWorkingData(G4std::ostream& out)
{
out << "DATA;\n";
// STEPentity* se;
@@ -5,8 +5,8 @@
//
// $Id: STEPfile_inline.cc,v 1.2 1999/05/21 20:20:51 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPfile_inline.cc,v 1.4 1999/12/15 18:20:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -129,7 +129,7 @@ STEPfile::SetFileType(FileTypeCode ft)
const char*
STEPfile::TruncFileName(const char* filename) const
{
char* tmp = strrchr(filename,'/');
const char* tmp = strrchr(filename,'/');
if (tmp) return tmp++;
else return filename;
@@ -142,7 +142,7 @@ STEPfile::ReadExchangeFile(const char* filename)
{
_error.ClearErrorMsg();
_errorCount = 0;
istream* in = OpenInputFile(filename);
G4std::istream* in = OpenInputFile(filename);
if (_error.severity() < SEVERITY_WARNING)
{
CloseInputFile(in);
@@ -163,7 +163,7 @@ STEPfile::AppendExchangeFile (const char* filename)
{
_error.ClearErrorMsg();
_errorCount = 0;
istream* in = OpenInputFile(filename);
G4std::istream* in = OpenInputFile(filename);
if (_error.severity() < SEVERITY_WARNING)
{
CloseInputFile(in);
@@ -180,7 +180,7 @@ STEPfile::ReadWorkingFile(const char* filename)
{
_error.ClearErrorMsg();
_errorCount = 0;
istream* in = OpenInputFile(filename);
G4std::istream* in = OpenInputFile(filename);
if (_error.severity() < SEVERITY_WARNING)
{
CloseInputFile(in);
@@ -203,7 +203,7 @@ STEPfile::AppendWorkingFile(const char* filename)
{
_error.ClearErrorMsg();
_errorCount = 0;
istream* in = OpenInputFile(filename);
G4std::istream* in = OpenInputFile(filename);
if (_error.severity() < SEVERITY_WARNING)
{
CloseInputFile(in);
@@ -219,7 +219,7 @@ STEPfile::AppendWorkingFile(const char* filename)
/******************************************************/
istream*
G4std::istream*
STEPfile::OpenInputFile (const char* filename)
{
// if there's no filename to use, fail
@@ -239,10 +239,10 @@ STEPfile::OpenInputFile (const char* filename)
return (0);
}
}
// istream* in = new istream(FileName(), io_readonly, a_useonly);
// G4std::istream* in = new G4std::istream(FileName(), io_readonly, a_useonly);
// port 29-Mar-1994 kcm
istream* in = new ifstream(FileName());
// default for ostream is readonly and protections are set to 644
G4std::istream* in = new G4std::ifstream(FileName());
// default for G4std::ostream is readonly and protections are set to 644
// if ( !in || !(in -> readable ()) )
if ( !in || !(in -> good ()) )
{
@@ -257,7 +257,7 @@ STEPfile::OpenInputFile (const char* filename)
/******************************************************/
void
STEPfile::CloseInputFile(istream* in)
STEPfile::CloseInputFile(G4std::istream* in)
{
delete in;
}
@@ -267,7 +267,7 @@ STEPfile::CloseInputFile(istream* in)
/*
void
STEPfile::ReadWhiteSpace (istream& in)
STEPfile::ReadWhiteSpace (G4std::istream& in)
{
char c = ' ';
@@ -280,7 +280,7 @@ STEPfile::ReadWhiteSpace (istream& in)
/***************************
***************************/
ofstream*
G4std::ofstream*
STEPfile::OpenOutputFile(const char* filename)
{
if (!filename)
@@ -304,10 +304,10 @@ STEPfile::OpenOutputFile(const char* filename)
if (_currentDir->FileExists(TruncFileName(FileName())))
MakeBackupFile();
// ostream* out = new ostream(FileName(), io_writeonly, a_create);
// G4std::ostream* out = new G4std::ostream(FileName(), io_writeonly, a_create);
// - port 29-Mar-1994 kcm
ofstream* out = new ofstream(FileName());
// default for ostream is writeonly and protections are set to 644
G4std::ofstream* out = new G4std::ofstream(FileName());
// default for G4std::ostream is writeonly and protections are set to 644
if (!out)
{
_error.AppendToUserMsg("unable to open file for output\n");
@@ -317,7 +317,7 @@ STEPfile::OpenOutputFile(const char* filename)
}
void
STEPfile::CloseOutputFile(ostream* out)
STEPfile::CloseOutputFile(G4std::ostream* out)
{
delete out;
}
+14 -18
View File
@@ -5,8 +5,8 @@
//
// $Id: STEPselect.cc,v 1.3 1999/11/17 08:34:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPselect.cc,v 1.4 1999/12/15 14:50:17 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -25,11 +25,7 @@
#include <STEPselect.h>
#include <stdio.h> // to get the BUFSIZ #define
#include <ExpDict.h>
#ifdef WIN32
# include <Strstrea.h>
#else
# include <strstream.h>
#endif
#include "g4std/strstream"
#include <STEPentity.h>
/**********
@@ -155,7 +151,7 @@ SdaiSelect::SelectValidLevel(const char *attrValue, ErrorDescriptor *err,
// s = tmp -> StrToVal
// (attrValue, CurrentUnderlyingType () -> Name (), err, im);
// else
istrstream paska((char *)attrValue);
G4std::istrstream paska((char *)attrValue);
s = tmp -> STEPread (paska, err, im);
delete tmp;
return s;
@@ -212,7 +208,7 @@ SdaiSelect::StrToVal(const char *Val, const char *selectType,
case INTEGER_TYPE:
default:
{
istrstream paska((char *)Val);
G4std::istrstream paska((char *)Val);
err->GreaterSeverity( STEPread_content( paska ) );
if(_error.severity() != SEVERITY_NULL)
err->AppendFromErrorArg(&_error);
@@ -223,7 +219,7 @@ SdaiSelect::StrToVal(const char *Val, const char *selectType,
}
Severity
SdaiSelect::STEPread (istream& in, ErrorDescriptor *err, InstMgr * instances,
SdaiSelect::STEPread (G4std::istream& in, ErrorDescriptor *err, InstMgr * instances,
int addFileId)
{
char c ='\0';
@@ -232,7 +228,7 @@ SdaiSelect::STEPread (istream& in, ErrorDescriptor *err, InstMgr * instances,
// find out what case we have
// NOTE case C falls out of recursive calls in cases A and B
in >> ws;
in >> G4std::ws;
in >> c;
// c = in.peek();
if( isalpha(c) ) // case B
@@ -251,12 +247,12 @@ SdaiSelect::STEPread (istream& in, ErrorDescriptor *err, InstMgr * instances,
if( SetUnderlyingType( CanBe( tmp.chars() ) ) )
{ // assign the value to the underlying type
in >> ws; // skip white space
in >> G4std::ws; // skip white space
STEPread_content (in, instances, addFileId);
// STEPread_content uses the ErrorDesc data member from the STEPselect class
err->AppendToDetailMsg (Error ());
err->GreaterSeverity( severity () );
in >> ws >> c;
in >> G4std::ws >> c;
if( c != ')' )
{
err->AppendToDetailMsg(
@@ -414,7 +410,7 @@ SdaiSelect::STEPread (istream& in, ErrorDescriptor *err, InstMgr * instances,
void
SdaiSelect::STEPwrite(ostream& out) const
SdaiSelect::STEPwrite(G4std::ostream& out) const
{
if (!exists ()) {
out << "$";
@@ -434,9 +430,9 @@ SdaiSelect::STEPwrite(ostream& out) const
const char *
SdaiSelect::STEPwrite(SCLstring& s) const
{
strstream buf;
G4std::strstream buf;
STEPwrite (buf);
buf << ends; // have to add the terminating \0 char
buf << G4std::ends; // have to add the terminating \0 char
char * tmp;
tmp = buf.str ();
s = tmp;
@@ -455,10 +451,10 @@ SdaiSelect::STEPwrite(SCLstring& s) const
char*
SdaiSelect::asStr() const
{
strstream buf;
G4std::strstream buf;
STEPwrite (buf);
/* STEPwrite_content (buf);*/
buf << ends; // have to add the terminating \0 char
buf << G4std::ends; // have to add the terminating \0 char
return buf.str (); // need to delete this space
}
#endif
+8 -12
View File
@@ -5,8 +5,8 @@
//
// $Id: STEPstring.cc,v 1.2 1999/05/21 20:20:52 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPstring.cc,v 1.3 1999/12/15 14:50:17 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -22,14 +22,10 @@
/* */
#include <STEPstring.h>
#ifdef WIN32
# include <Strstrea.h>
#else
# include <strstream.h>
#endif
#include "g4std/strstream"
void
SdaiString::STEPwrite (ostream& out) const
SdaiString::STEPwrite (G4std::ostream& out) const
{
const char *str = 0;
// strings that exist but do not contain any chars should be written as '',
@@ -89,17 +85,17 @@ SdaiString::StrToVal (const char * s)
// STEPread reads a string in exchange file format
// starting with a single quote
Severity
SdaiString::STEPread (istream& in, ErrorDescriptor *err)
SdaiString::STEPread (G4std::istream& in, ErrorDescriptor *err)
{
int foundEndQuote = 0; // need so this string is not ok: 'hi''
set_null (); // clear the old string
char c;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
in >> c;
// remember the current format state to restore the previous settings
long int flags = in.flags();
in.unsetf(ios::skipws);
in.unsetf(G4std::ios::skipws);
if (c == STRING_DELIM)
{
@@ -146,6 +142,6 @@ SdaiString::STEPread (istream& in, ErrorDescriptor *err)
Severity
SdaiString::STEPread (const char *s, ErrorDescriptor *err)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return STEPread (in, err);
}
@@ -5,8 +5,8 @@
//
// $Id: STEPundefined.cc,v 1.2 1999/05/21 20:20:53 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: STEPundefined.cc,v 1.3 1999/12/15 14:50:17 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -40,7 +40,7 @@ SCLundefined::StrToVal(const char *s, ErrorDescriptor *err)
}
Severity
SCLundefined::StrToVal(istream &in, ErrorDescriptor *err)
SCLundefined::StrToVal(G4std::istream &in, ErrorDescriptor *err)
{
return STEPread(in, err);
}
@@ -48,20 +48,20 @@ SCLundefined::StrToVal(istream &in, ErrorDescriptor *err)
Severity
SCLundefined::STEPread(const char *s, ErrorDescriptor *err)
{
istrstream in((char *) s);
G4std::istrstream in((char *) s);
return STEPread(in, err);
}
Severity
SCLundefined::STEPread(istream &in, ErrorDescriptor *err)
SCLundefined::STEPread(G4std::istream &in, ErrorDescriptor *err)
{
char c = '\0';
strstream ss;
G4std::strstream ss;
SCLstring str;
int terminal = 0;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
in >> c;
if(c == '$')
{
@@ -118,7 +118,7 @@ SCLundefined::STEPread(istream &in, ErrorDescriptor *err)
// if (!in.readable ()) terminal =1;
}
ss << ends;
ss << G4std::ends;
val = ss.str();
err->GreaterSeverity(SEVERITY_NULL);
@@ -145,7 +145,7 @@ SCLundefined::STEPwrite(SCLstring &s)
}
void
SCLundefined:: STEPwrite (ostream& out)
SCLundefined:: STEPwrite (G4std::ostream& out)
{
if(val.rep())
out << val.chars();
@@ -196,7 +196,7 @@ SCLundefined::is_null ()
/*
int
SCLundefined::STEPread(istream& in )
SCLundefined::STEPread(G4std::istream& in )
{
char c ='\0';
char buf [BUFSIZ];
+14 -14
View File
@@ -5,8 +5,8 @@
//
// $Id: SdaiBinary.cc,v 1.2 1999/05/21 20:20:53 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: SdaiBinary.cc,v 1.3 1999/12/15 14:50:17 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -24,12 +24,12 @@
#include <SdaiBinary.h>
extern Severity
CheckRemainingInput(istream &in, ErrorDescriptor *err,
CheckRemainingInput(G4std::istream &in, ErrorDescriptor *err,
const char *typeName, // used in error message
const char *tokenList); // e.g. ",)"
void
SdaiBinary::STEPwrite (ostream& out) const
SdaiBinary::STEPwrite (G4std::ostream& out) const
{
const char *str = 0;
if (is_null ())
@@ -71,7 +71,7 @@ SdaiBinary::STEPwrite (SCLstring &s) const
}
Severity
SdaiBinary::ReadBinary(istream& in, ErrorDescriptor *err, int AssignVal,
SdaiBinary::ReadBinary(G4std::istream& in, ErrorDescriptor *err, int AssignVal,
int needDelims)
{
if(AssignVal)
@@ -84,7 +84,7 @@ SdaiBinary::ReadBinary(istream& in, ErrorDescriptor *err, int AssignVal,
int validDelimiters = 1;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
if( in.good() )
{
@@ -165,7 +165,7 @@ SdaiBinary::ReadBinary(istream& in, ErrorDescriptor *err, int AssignVal,
Severity
SdaiBinary::StrToVal (const char * s, ErrorDescriptor *err)
{
istrstream in ((char *)s); // sz defaults to length of s
G4std::istrstream in ((char *)s); // sz defaults to length of s
return ReadBinary(in, err, 1, 0);
}
@@ -256,19 +256,19 @@ SdaiBinary::StrToVal (const char * s, ErrorDescriptor *err)
// delimited by double quotes
Severity
SdaiBinary::STEPread (istream& in, ErrorDescriptor *err)
SdaiBinary::STEPread (G4std::istream& in, ErrorDescriptor *err)
{
return ReadBinary(in, err, 1, 1);
/*
int foundEndQuote = 0; // need so this string is not ok: 'hi''
set_null (); // clear the old string
char c;
in >> ws; // skip white space
in >> G4std::ws; // skip white space
in >> c;
// remember the current format state to restore the previous settings
long int flags = in.flags();
in.unsetf(ios::skipws);
in.unsetf(G4std::ios::skipws);
if (c == BINARY_DELIM)
{
@@ -299,7 +299,7 @@ SdaiBinary::STEPread (istream& in, ErrorDescriptor *err)
Severity
SdaiBinary::STEPread (const char *s, ErrorDescriptor *err)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return STEPread (in, err);
}
@@ -324,14 +324,14 @@ SdaiBinary::STEPread (const char *s, ErrorDescriptor *err)
///////////////////////////////////////////////////////////////////////////////
Severity
SdaiBinary::BinaryValidLevel (istream &in, ErrorDescriptor *err,
SdaiBinary::BinaryValidLevel (G4std::istream &in, ErrorDescriptor *err,
int optional, char *tokenList,
int needDelims, int clearError)
{
if(clearError)
err->ClearErrorMsg();
in >> ws; // skip white space
in >> G4std::ws; // skip white space
char c = in.peek();
if(c == '$' || in.eof())
{
@@ -366,7 +366,7 @@ SdaiBinary::BinaryValidLevel (const char *value, ErrorDescriptor *err,
int optional, char *tokenList,
int needDelims, int clearError)
{
istrstream in((char *)value);
G4std::istrstream in((char *)value);
return BinaryValidLevel (in, err, optional, tokenList,
needDelims, clearError);
}
File diff suppressed because it is too large Load Diff
@@ -6,7 +6,7 @@
//
// $Id: SdaiCONFIG_CONTROL_DESIGN_init.cc,v 1.2 1999/05/21 20:21:03 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef SDAICONFIG_CONTROL_DESIGN_INIT_CC
#define SDAICONFIG_CONTROL_DESIGN_INIT_CC
@@ -6,7 +6,7 @@
//
// $Id: SingleLinkList.cc,v 1.2 1999/05/21 20:21:05 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -5,8 +5,8 @@
//
// $Id: SingleLinkList_inline.cc,v 1.2 1999/05/21 20:21:05 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: SingleLinkList_inline.cc,v 1.4 1999/12/15 18:04:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -23,11 +23,8 @@
/* */
#include <SingleLinkList.h>
#ifdef WIN32
# include "G4ios.hh"
#else
# include <stream.h>
#endif
#include "G4ios.hh"
SingleLinkNode *
SingleLinkNode::NextNode () const
@@ -61,7 +58,7 @@ SingleLinkNode *
SingleLinkList::NewNode ()
{
// defined in subtypes
cerr << "\n\n******BUG****** a virtually defined function should \n"
G4cerr << "\n\n******BUG****** a virtually defined function should \n"
<< "be called for SingleLinkList::NewNode()\n\n";
return new SingleLinkNode();
}
+7 -7
View File
@@ -5,8 +5,8 @@
//
// $Id: Str.cc,v 1.2 1999/05/21 20:21:06 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: Str.cc,v 1.3 1999/12/15 14:50:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -154,8 +154,8 @@ PrettyNewName (const char * oldname)
// this function can push the file pointer up to but not past the delimiter
// (i.e. not removing the delimiter from the input stream). If you have a
// string containing a single value and you expect the whole string to contain
// a valid value, you can change the string to an istrstream, read the value
// then send the istrstream to this function with tokenList set to null
// a valid value, you can change the string to an G4std::istrstream, read the value
// then send the G4std::istrstream to this function with tokenList set to null
// and this function will set an error for you if any input remains following
// the value.
@@ -178,7 +178,7 @@ PrettyNewName (const char * oldname)
// no way to know when to stop.
Severity
CheckRemainingInput(istream &in, ErrorDescriptor *err,
CheckRemainingInput(G4std::istream &in, ErrorDescriptor *err,
const char *typeName, // used in error message
const char *tokenList) // e.g. ",)"
{
@@ -195,7 +195,7 @@ CheckRemainingInput(istream &in, ErrorDescriptor *err,
// preceding a delimiter if you are expecting one.
in.clear(); // clear the istreams error
in >> ws; // skip whitespace
in >> G4std::ws; // skip whitespace
if(in.eof()) // no input following the desired input (or following the
{ // missing desired input)
return err->severity();
@@ -278,7 +278,7 @@ CheckRemainingInput(istream &in, ErrorDescriptor *err,
return err->severity();
}
else
{ // badbit set (in.bad()) means there was a problem when reading istream
{ // badbit set (in.bad()) means there was a problem when reading G4std::istream
// this is bad news... it means the input stream is hopelessly messed up
err->GreaterSeverity(SEVERITY_INPUT_ERROR);
sprintf(name, "Invalid %s value.\n", typeName);
+1 -1
View File
@@ -6,7 +6,7 @@
//
// $Id: cmdmgr.cc,v 1.2 1999/05/21 20:21:06 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
+1 -1
View File
@@ -6,7 +6,7 @@
//
// $Id: dirobj.cc,v 1.2 1999/05/21 20:21:07 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
+1 -1
View File
@@ -6,7 +6,7 @@
//
// $Id: dispnode.cc,v 1.2 1999/05/21 20:21:07 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -6,7 +6,7 @@
//
// $Id: dispnodelist.cc,v 1.2 1999/05/21 20:21:08 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
+3 -3
View File
@@ -5,8 +5,8 @@
//
// $Id: errordesc.cc,v 1.2 1999/05/21 20:21:08 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: errordesc.cc,v 1.3 1999/12/15 14:50:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -25,7 +25,7 @@
#include <errordesc.h>
DebugLevel ErrorDescriptor::_debug_level = DEBUG_OFF;
ostream * ErrorDescriptor::_out = 0;
G4std::ostream * ErrorDescriptor::_out = 0;
ErrorDescriptor::ErrorDescriptor ( Severity s, DebugLevel d)
: _severity (s),
@@ -6,7 +6,7 @@
//
// $Id: gennode_inline.cc,v 1.2 1999/05/21 20:21:08 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef gennode_inline_cc
@@ -6,7 +6,7 @@
//
// $Id: gennodearray.cc,v 1.2 1999/05/21 20:21:09 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
+3 -3
View File
@@ -5,8 +5,8 @@
//
// $Id: instmgr.cc,v 1.3 1999/05/21 20:21:09 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: instmgr.cc,v 1.4 1999/12/15 14:50:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -55,7 +55,7 @@ InstMgr::PrintSortedFileIds()
for(i = 0; i < count; i++)
{
mn = (MgrNode *)((*sortedMaster)[i]);
G4cout << i << " " << mn->GetFileId() << endl;
G4cout << i << " " << mn->GetFileId() << G4endl;
}
}
+3 -7
View File
@@ -5,8 +5,8 @@
//
// $Id: mgrnode.cc,v 1.2 1999/05/21 20:21:09 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: mgrnode.cc,v 1.3 1999/12/15 18:04:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -30,11 +30,7 @@
#include <instmgr.h>
#include <STEPentity.h>
#ifdef WIN32
# include "G4ios.hh"
#else
# include <stream.h>
#endif
#include "G4ios.hh"
void *MgrNode::SEE()
{
@@ -6,7 +6,7 @@
//
// $Id: mgrnodearray.cc,v 1.2 1999/05/21 20:21:10 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
@@ -6,7 +6,7 @@
//
// $Id: mgrnodelist.cc,v 1.2 1999/05/21 20:21:10 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*
+55 -55
View File
@@ -5,8 +5,8 @@
//
// $Id: read_func.cc,v 1.2 1999/05/21 20:21:10 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: read_func.cc,v 1.3 1999/12/15 14:50:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifdef __O3DB__
#include <OpenOODB.h>
@@ -45,20 +45,20 @@ PrintErrorState(ErrorDescriptor &err)
G4cout << err.DetailMsg() << "\n";
}
// Print istream error information for debugging purposes
void IStreamState(istream &in)
// Print G4std::istream error information for debugging purposes
void IStreamState(G4std::istream &in)
{
if( in.good())
{
G4cerr << "istream GOOD\n" << flush;
G4cerr << "istream GOOD\n" << G4std::flush;
}
if( in.fail() )
{
G4cerr << "istream FAIL\n" << flush;
G4cerr << "istream FAIL\n" << G4std::flush;
}
if( in.eof() )
{
G4cerr << "istream EOF\n" << flush;
G4cerr << "istream EOF\n" << G4std::flush;
}
}
@@ -72,7 +72,7 @@ void IStreamState(istream &in)
// a severity level and error message (no error MESSAGE is set for severity
// incomplete).
// * tokenList contains characters that Terminate reading the value.
// * If tokenList is not zero then the istream will be read until a character
// * If tokenList is not zero then the G4std::istream will be read until a character
// is found matching a character in tokenlist. All values read up to the
// terminating character (delimiter) must be valid or err will be set with an
// appropriate error message. A valid value may still have been assigned
@@ -84,11 +84,11 @@ void IStreamState(istream &in)
///////////////////////////////////////////////////////////////////////////////
int
ReadInteger(SdaiInteger &val, istream &in, ErrorDescriptor *err,
ReadInteger(SdaiInteger &val, G4std::istream &in, ErrorDescriptor *err,
char *tokenList)
{
SdaiInteger i = 0;
in >> ws;
in >> G4std::ws;
in >> i;
int valAssigned = 0;
@@ -112,7 +112,7 @@ int
ReadInteger(SdaiInteger &val, const char *s, ErrorDescriptor *err,
char *tokenList)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return ReadInteger(val, in, err, tokenList);
}
@@ -143,8 +143,8 @@ IntValidLevel (const char *attrValue, ErrorDescriptor *err,
if(clearError)
err->ClearErrorMsg();
istrstream in((char *)attrValue);
in >> ws; // skip white space
G4std::istrstream in((char *)attrValue);
in >> G4std::ws; // skip white space
char c = in.peek();
if(in.eof())
{
@@ -179,7 +179,7 @@ IntValidLevel (const char *attrValue, ErrorDescriptor *err,
// a severity level and error message (no error MESSAGE is set for severity
// incomplete).
// * tokenList contains characters that Terminate reading the value.
// * If tokenList is not zero then the istream will be read until a character
// * If tokenList is not zero then the G4std::istream will be read until a character
// is found matching a character in tokenlist. All values read up to the
// terminating character (delimiter) must be valid or err will be set with an
// appropriate error message. A valid value may still have been assigned
@@ -190,11 +190,11 @@ IntValidLevel (const char *attrValue, ErrorDescriptor *err,
///////////////////////////////////////////////////////////////////////////////
int
ReadReal(SdaiReal &val, istream &in, ErrorDescriptor *err,
ReadReal(SdaiReal &val, G4std::istream &in, ErrorDescriptor *err,
char *tokenList)
{
SdaiReal d = 0;
in >> ws;
in >> G4std::ws;
in >> d;
// IStreamState(in);
@@ -219,7 +219,7 @@ int
ReadReal(SdaiReal &val, const char *s, ErrorDescriptor *err,
char *tokenList)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return ReadReal(val, in, err, tokenList);
}
@@ -250,8 +250,8 @@ RealValidLevel (const char *attrValue, ErrorDescriptor *err,
if(clearError)
err->ClearErrorMsg();
istrstream in((char *)attrValue);
in >> ws; // skip white space
G4std::istrstream in((char *)attrValue);
in >> G4std::ws; // skip white space
char c = in.peek();
if(in.eof())
{
@@ -286,7 +286,7 @@ RealValidLevel (const char *attrValue, ErrorDescriptor *err,
// a severity level and error message (no error MESSAGE is set for severity
// incomplete).
// * tokenList contains characters that Terminate reading the value.
// * If tokenList is not zero then the istream will be read until a character
// * If tokenList is not zero then the G4std::istream will be read until a character
// is found matching a character in tokenlist. All values read up to the
// terminating character (delimiter) must be valid or err will be set with an
// appropriate error message. A valid value may still have been assigned
@@ -297,11 +297,11 @@ RealValidLevel (const char *attrValue, ErrorDescriptor *err,
///////////////////////////////////////////////////////////////////////////////
int
ReadNumber(SdaiReal &val, istream &in, ErrorDescriptor *err,
ReadNumber(SdaiReal &val, G4std::istream &in, ErrorDescriptor *err,
char *tokenList)
{
SdaiReal d = 0;
in >> ws;
in >> G4std::ws;
in >> d;
// IStreamState(in);
@@ -324,7 +324,7 @@ int
ReadNumber(SdaiReal &val, const char *s, ErrorDescriptor *err,
char *tokenList)
{
istrstream in((char *)s);
G4std::istrstream in((char *)s);
return ReadNumber(val, in, err, tokenList);
}
@@ -356,8 +356,8 @@ NumberValidLevel (const char *attrValue, ErrorDescriptor *err,
if(clearError)
err->ClearErrorMsg();
istrstream in((char *)attrValue);
in >> ws; // skip white space
G4std::istrstream in((char *)attrValue);
in >> G4std::ws; // skip white space
char c = in.peek();
if(in.eof())
{
@@ -386,7 +386,7 @@ NumberValidLevel (const char *attrValue, ErrorDescriptor *err,
// return 1 if 'in' points at a quoted quote otherwise return 0
int
QuoteInString(istream& in)
QuoteInString(G4std::istream& in)
{
char c1, c2;
if( in.good() )
@@ -408,13 +408,13 @@ QuoteInString(istream& in)
// 'in'.
void
PushPastString (istream& in, SCLstring &s, ErrorDescriptor *err)
PushPastString (G4std::istream& in, SCLstring &s, ErrorDescriptor *err)
{
char messageBuf[BUFSIZ];
messageBuf[0] = '\0';
char c;
in >> ws; // skip whitespace
in >> G4std::ws; // skip whitespace
in >> c;
if(c == STRING_DELIM)
{
@@ -458,13 +458,13 @@ PushPastString (istream& in, SCLstring &s, ErrorDescriptor *err)
// aggregates.
void
PushPastImbedAggr (istream& in, SCLstring &s, ErrorDescriptor *err)
PushPastImbedAggr (G4std::istream& in, SCLstring &s, ErrorDescriptor *err)
{
char messageBuf[BUFSIZ];
messageBuf[0] = '\0';
char c;
in >> ws;
in >> G4std::ws;
in.get(c);
if(c == '(')
@@ -506,13 +506,13 @@ PushPastImbedAggr (istream& in, SCLstring &s, ErrorDescriptor *err)
// to contain an aggregate as an element.
void
PushPastAggr1Dim(istream& in, SCLstring &s, ErrorDescriptor *err)
PushPastAggr1Dim(G4std::istream& in, SCLstring &s, ErrorDescriptor *err)
{
char messageBuf[BUFSIZ];
messageBuf[0] = '\0';
char c;
in >> ws;
in >> G4std::ws;
in.get(c);
if(c == '(')
@@ -552,11 +552,11 @@ PushPastAggr1Dim(istream& in, SCLstring &s, ErrorDescriptor *err)
/***************************
* FindStartOfInstance reads to the beginning of an instance marked by #
* it copies what is read to the SCLstring inst. It leaves the # on the
* istream.
* G4std::istream.
***************************/
Severity
FindStartOfInstance(istream& in, SCLstring& inst)
FindStartOfInstance(G4std::istream& in, SCLstring& inst)
{
char c =0;
ErrorDescriptor errs;
@@ -596,7 +596,7 @@ FindStartOfInstance(istream& in, SCLstring& inst)
***************************/
Severity
SkipInstance (istream& in, SCLstring& inst)
SkipInstance (G4std::istream& in, SCLstring& inst)
{
char c =0;
ErrorDescriptor errs;
@@ -639,12 +639,12 @@ SkipInstance (istream& in, SCLstring& inst)
***************************/
const char *
SkipSimpleRecord(istream &in, SCLstring &buf, ErrorDescriptor *err)
SkipSimpleRecord(G4std::istream &in, SCLstring &buf, ErrorDescriptor *err)
{
char c;
SCLstring s;
in >> ws;
in >> G4std::ws;
in.get(c);
if(c == '(') // beginning of record
{
@@ -687,11 +687,11 @@ SkipSimpleRecord(istream &in, SCLstring &buf, ErrorDescriptor *err)
***************************/
const char *
ReadStdKeyword(istream& in, SCLstring &buf, int skipInitWS)
ReadStdKeyword(G4std::istream& in, SCLstring &buf, int skipInitWS)
{
char c;
if(skipInitWS)
in >> ws;
in >> G4std::ws;
while( in.get(c) && !isspace(c) && ( isalnum(c) || (c == '_') ) )
{
@@ -706,9 +706,9 @@ ReadStdKeyword(istream& in, SCLstring &buf, int skipInitWS)
/***************************
This function returns a null terminated const char* for the
characters read from the istream up to, but not including
characters read from the G4std::istream up to, but not including
the first character found in the set of delimiters, or the
whitespace character. It leaves the delimiter on the istream.
whitespace character. It leaves the delimiter on the G4std::istream.
The string is returned in a static buffer, so it will change
the next time the function is called.
@@ -719,7 +719,7 @@ digits, underscore characters, and possibly an exclamation mark.
The "!" shall appear only once, and only as the first character.
***************************/
const char*
GetKeyword(istream& in, const char* delims, ErrorDescriptor &err)
GetKeyword(G4std::istream& in, const char* delims, ErrorDescriptor &err)
{
char c;
int sz = 1;
@@ -755,17 +755,17 @@ GetKeyword(istream& in, const char* delims, ErrorDescriptor &err)
// otherwise return 0. This gobbles up the input stream until it knows
// that it does or does not have the ENDSEC keyword (and semicolon). i.e.
// the first character that stops matching the keyword ENDSEC; (including the
// semicolon) will be put back onto the istream, everything else will remain
// semicolon) will be put back onto the G4std::istream, everything else will remain
// read. It is this way so that checking for the keywd the next time will
// start with the correct char or if it doesn't find it the non-matching char
// may be what you are looking for next (e.g. someone typed in END; and the
// next chars are DATA; for the beginning of the data section).
int
FoundEndSecKywd(istream& in, ErrorDescriptor &err)
FoundEndSecKywd(G4std::istream& in, ErrorDescriptor &err)
{
char c;
in >> ws;
in >> G4std::ws;
in.get(c);
if(c == 'E')
@@ -785,7 +785,7 @@ FoundEndSecKywd(istream& in, ErrorDescriptor &err)
in.get(c);
if(c == 'C')
{
in >> ws;
in >> G4std::ws;
in.get(c);
if(c == ';')
{
@@ -877,11 +877,11 @@ const char * ReadComment(SCLstring &ss, const char *s)
***************************/
const char *
ReadComment(istream& in, SCLstring &s)
ReadComment(G4std::istream& in, SCLstring &s)
{
char c = '\0';
int commentLength = 0;
in >> ws;
in >> G4std::ws;
in >> c;
// it looks like a comment so far
@@ -890,7 +890,7 @@ ReadComment(istream& in, SCLstring &s)
in.get(c); // won't skip space
if (c == '*') // it is a comment
{
in >> ws; // skip leading comment space
in >> G4std::ws; // skip leading comment space
// only to keep it from completely gobbling up input
while( commentLength <= MAX_COMMENT_LENGTH )
@@ -934,12 +934,12 @@ ReadComment(istream& in, SCLstring &s)
}
/***************************
** Read a Print Control Directive from the istream
** Read a Print Control Directive from the G4std::istream
** "\F\" == formfeed
** "\N\" == newline
***************************/
Severity
ReadPcd(istream& in)
ReadPcd(G4std::istream& in)
{
char c;
in.get(c);
@@ -958,15 +958,15 @@ ReadPcd(istream& in)
/******************************
This function reads through token separators
from an istream. It returns when a token
separator is not the next thing on the istream.
from an G4std::istream. It returns when a token
separator is not the next thing on the G4std::istream.
The token separators are blanks, explicit Print control directives,
and comments.
Part 21 considers the blank to be the space character,
but this function considers blanks to be the return value of isspace(c)
******************************/
void
ReadTokenSeparator(istream& in, SCLstring *comments)
ReadTokenSeparator(G4std::istream& in, SCLstring *comments)
{
char c;
SCLstring s; // used if need to read a comment
@@ -980,7 +980,7 @@ ReadTokenSeparator(istream& in, SCLstring *comments)
while (in)
{
in >> ws; // skip white space.
in >> G4std::ws; // skip white space.
c = in.peek(); // look at next char on input stream
switch (c)
@@ -6,7 +6,7 @@
//
// $Id: s_HEADER_SCHEMA.cc,v 1.2 1999/05/21 20:21:12 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef S_HEADER_SCHEMA_CC
#define S_HEADER_SCHEMA_CC
@@ -6,7 +6,7 @@
//
// $Id: s_HEADER_SCHEMA_init.cc,v 1.2 1999/05/21 20:21:12 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef S_HEADER_SCHEMA_INIT_CC
#define S_HEADER_SCHEMA_INIT_CC
+1 -1
View File
@@ -6,7 +6,7 @@
//
// $Id: schema.cc,v 1.2 1999/05/21 20:21:12 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
#ifndef SCHEMA_CC
#define SCHEMA_CC
+1 -1
View File
@@ -6,7 +6,7 @@
//
// $Id: scl_hash.cc,v 1.2 1999/05/21 20:21:13 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/* ""; */
@@ -6,7 +6,7 @@
//
// $Id: scl_string.cc,v 1.2 1999/05/21 20:21:13 japost Exp $
// GEANT4 tag $Name: geant4-01-00 $
// GEANT4 tag $Name: geant4-01-01 $
//
/*