Import Geant4 7.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 12:11:21 +02:00
parent 516dbf1a58
commit d93e1e39a9
5384 changed files with 125662 additions and 82444 deletions
+12 -5
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.18 2004/06/04 14:17:54 duns Exp $
# $Id: GNUmakefile,v 1.23 2005/06/28 08:47:50 gcosmo Exp $
name := G4visHepRep
@@ -7,6 +7,9 @@ ifndef G4INSTALL
endif
GLOBLIBS = libG4vis_management.lib libG4modeling.lib
ifdef G4LIB_BUILD_ZLIB
GLOBLIBS += libG4zlib.lib
endif
GLOBLIBS += libG4run.lib libG4event.lib
GLOBLIBS += libG4tracking.lib libG4processes.lib libG4digits_hits.lib
GLOBLIBS += libG4track.lib libG4particles.lib libG4geometry.lib
@@ -17,10 +20,14 @@ include $(G4INSTALL)/config/architecture.gmk
include $(G4INSTALL)/config/G4VIS_BUILD.gmk
include $(G4INSTALL)/config/interactivity.gmk
CPPFLAGS += -DDEBUG -DZ_PREFIX
CPPFLAGS += -I$(G4BASE)/visualization/HepRep/include/ref
CPPFLAGS += -I$(G4BASE)/visualization/HepRep/include/zipios++
CPPFLAGS += -I$(G4BASE)/visualization/HepRep/include/zlib
ifdef G4LIB_USE_ZLIB
CPPFLAGS += -DG4LIB_USE_ZLIB
ifdef G4LIB_BUILD_ZLIB
CPPFLAGS += -I$(G4BASE)/visualization/externals/zlib/include
endif
else
CPPFLAGS += -DCHEPREP_NO_ZLIB
endif
CPPFLAGS += -I$(G4BASE)/event/include
CPPFLAGS += -I$(G4BASE)/track/include
+73 -1
View File
@@ -1,4 +1,4 @@
.$Id: History,v 1.78 2004/11/22 19:31:37 duns Exp $
.$Id: History,v 1.97 2005/06/28 12:23:23 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -19,6 +19,78 @@ committal in the CVS repository !
History file for visualization/HepRep sub-category
--------------------------------------------------
28 June 2005 Gabriele Cosmo (vis-HepRep-V07-00-04)
- Fixed GNUmakefile to include ZLIB module for DLLs build on Windows.
2 June 2005 Mark Donszelmann (vis-HepRep-V07-00-03)
- HepRepXML (heprep2) handles: Solids, Attributes on Hits and Tracks.
- cheprep at 2.0.5, fix for g++ 4.0.
1 June 2005 Joseph Perl
- For HeRepFile, use attributes from hits.
1 June 2005 Mark Donszelmann (vis-HepRep-V07-00-02)
- updated documentation.
31 May 2005 Joseph Perl
- For HeRepFile, use G4AttCheck to standardize attribute units.
30 May 2005 Joseph Perl
- For HeRepFile, respect Drawing Mode.
30 May 2005 Joseph Perl
- For HeRepFile, make trajectory color come from visible->GetColour.
28 May 2005 Joseph Perl
- For HeRepFile, implement G4HEPREPFILE_CULL.
28 May 2005 Joseph Perl
- For HeRepFile, correct heprep xmlns reference.
25 May 2005 Joseph Perl
- For HeRepFile, allow user to specify output directory, filename
and whether to overwrite.
25 May 2005 Mark Donszelmann (vis-HepRep-V07-00-01 against geant4-07-00-ref-03)
- optionally needs externals/zlib (vis-zlib-V07-00-00)
- HEPREP at version 2.0.1
- cheprep at version 2.0.4
- Added writing an EOF marker for each binary HepRep file.
- Added version files to the copied filesets from FreeHEP.
24 May 2005 Joseph Perl
- Improve handling of solids (in HepRepFile).
16 May 2005 Mark Donszelmann
- Fixed problems with sequential heprep files, gz files,
too much info in the heprep file and some compilation mistakes.
12 May 2005 Mark Donszelmann
- Renamed zconf.h, zlib.h and zutil.h back into their old names.
- Removed -DZ_PREFIX from the zlib compilation step.
- Added G4LIB_BUILD_ZLIB for building zlib and G4LIB_USE_ZLIB for using zlib.
- Removed all files belonging to zipios++ from include and src.
- Removed all files from the ref include directory.
- Moved zlib to the externals/zlib package.
- Added cheprep src and include files and changed GNUmakefile.
3 May 2005 Mark Donszelmann
- Removed the following zlib and zipios files which are not necessary for writing
zip or gz files: include/zipios++/basicentry.h, include/zipios++/collcoll.h,
include/zipios++/dircoll.h, include/zipios++/filepath.h,
include/zipios++/filterinputstreambuf.h, include/zipios++/inflateinputstreambuf.h,
include/zipios++/zipfile.h, include/zipios++/zipinputstream.h,
include/zipios++/zipinputstreambuf.h,
include/zlib/inffast.h, include/zlib/inffixed.h, include/zlib/inflate.h,
include/zlib/inftrees.h, src/basicentry.cc, src/collcoll.cc, src/filepath.cc,
src/filterinputstreambuf.cc, src/infback.cc, src/inffast.cc, src/inflate.cc,
src/inflateinputstreambuf.cc, src/inftrees.cc, src/uncompr.cc, src/zipfile.cc,
src/zipinputstream.cc, src/zipinputstreambuf.cc
16 February 2005 Mark Donszelmann (vis-HepRep-V07-00-00 against geant4-07-00-ref-00)
- Fix for g++ compiler 2.95.2 on Linux.
22 November 2004 Mark Donszelmann (vis-HepRep-V06-02-02 against geant4-06-02-ref)
- Upgraded to latest version C++ HepRep driver from FreeHEP.
- Fixed GEANT-51, upgrade zlib to version 1.2.2 (for AMD64 compatibility).
+48 -22
View File
@@ -12,10 +12,28 @@ Driver: HepRepFile
------------------
The version of HepRep produced by this driver is HepRep Version 1.
Each call to /vis/viewer/update
rewrites the file G4HepRep.xml.
Writes files with file extension .heprep.
View the file using the WIRED Event Display, available from:
First file is written to current directory and is named G4Data0.heprep.
Subsequent files increment the number, as in G4Data1.heprep, G4Data2.heprep...
To specify a different output file directory (instead of current directory),
set G4HEPREPFILE_DIR
To specify a different output file name (instead of G4Data),
set G4HEPREPFILE_NAME
To repeatedly overwrite the same output file (instead of having incremental
numbers at the end of the file name),
set G4HEPREPFILE_OVERWRITE
By default, invisible objects are not culled but are left in the heprep file
with their visibility initially set to false (so that you can subsequently
choose to make them visible from within the heprep browser).
To force culling of invisible objects,
set G44HEPREPFILE_CULL
View the file using the WIRED3 HepRep Browser, available from:
http://www.slac.stanford.edu/BFROOT/www/Computing/Graphics/Wired/
WIRED can read xml files in zipped format as well as unzipped,
@@ -23,33 +41,46 @@ so you can save space by applying gzip to the xml file.
This will reduce the file to about five percent of its original size.
Joseph Perl
9 November 2001
2 June 2005
Driver: HepRepXML
-----------------
The version of HepRep produced by this driver is HepRep Version 2.
It uses ZLIB and ZIPIOS (included in the HepRep driver) to
compress the files if necessary. ZLIB and ZIPIOS are included in the
zlib and zipios++ include directories and further licensed and described there.
This driver can write both Binary HepRep (.bheprep) and XML HepRep
(.heprep) files. Binary HepRep files are a one-to-one translation
of XML HepRep files, but they are considerably shorter and faster
to parse by a HepRepViewer such as WIRED 4.
HepRep XML files can contain multiple HepRep events/geometries.
You can view the files using the WIRED 4 Event Display, available from:
http://wired4.freehep.org
Both Binary HepRep and XML HepRep can be compressed using the standard
zlib library if linked into Geant4 using G4LIB_USE_ZLIB. If a standard
zlib is not available (WIN32-VC for instance) you should also set
G4LIB_BUILD_ZLIB to build G4zlib included with Geant4.
HepRep files (Binary and XML) can contain multiple HepRep events/geometries.
If the file contains more than one HepRep it is not strictly XML anymore.
Files can be written in .heprep.zip .heprep.gz or .heprep format.
Files can be written in .heprep.zip, .heprep.gz or .heprep format and their
binary versions .bheprep.zip, .bheprep.gz or .bheprep.
The .heprep.zip is the default for file output, the .heprep is the default
for stdout and stderr.
(Optional) To set the filename, where the extension should be .heprep.zip
.heprep.gz or .heprep (.zip and .gz will compress), use:
(Optional) To set the filename with a particular extension such as:
.heprep.zip, .heprep.gz, .heprep, .bheprep.zip, .bheprep.gz or .bheprep
use for instance:
/vis/scene/create filename.heprep.zip
/vis/scene/create filename.bheprep.zip
(Optional) To create separate files for each event, you can set a suffix such as
"-0001" to start writing files from filename-0001.heprep.zip to
filename-9999.heprep.zip (or up), while "-55-sub" will start write files
filename-55-sub.heprep.zip to filename-99-sub.heprep.zip (or up).
"-0001" to start writing files from filename-0001.bheprep.zip to
filename-9999.bheprep.zip (or up), while "-55-sub" will start write files
filename-55-sub.bheprep.zip to filename-99-sub.bheprep.zip (or up).
/vis/heprep/setEventNumberSuffix -0001
(Note: suffix has to contain at least one digit)
@@ -110,16 +141,11 @@ This results in a smaller zip file, as the geometry is only written once. Use th
/vis/sceneHandler/remove scene-handler-0
View the file using the WIRED Event Display, available from:
http://wired.freehep.org
Limitations:
Only one SceneHandler can exist at any time, connected to a single Viewer.
Since the HepRep format is a model rather than a view this is not a real
limitation. In WIRED you can create as many views (SceneHandlers) as you like.
limitation. In WIRED 4 you can create as many views (SceneHandlers) as you like.
27 May 2004
1 June 2005
Mark.Donszelmann@slac.stanford.edu
-31
View File
@@ -1,31 +0,0 @@
export HEPREP=$FREEHEP/hep/graphics/heprep
cp $FREEHEP/org/freehep/jni/FreeHepTypes.h include/ref
#cp $FREEHEP/org/freehep/zip/zipios++/*.h include/zipios++
#cp $FREEHEP/org/freehep/zip/*.h include/zipios++
#cp $FREEHEP/org/freehep/zip/*.cpp src
#rm src/appendzip.cpp
#mv src/basicentry.cpp src/basicentry.cc
#mv src/collcoll.cpp src/collcoll.cc
#mv src/deflateoutputstreambuf.cpp src/deflateoutputstreambuf.cc
#mv src/fcoll.cpp src/fcoll.cc
#mv src/fcollexceptions.cpp src/fcollexceptions.cc
#mv src/fileentry.cpp src/fileentry.cc
#mv src/filepath.cpp src/filepath.cc
#mv src/filterinputstreambuf.cpp src/filterinputstreambuf.cc
#mv src/filteroutputstreambuf.cpp src/filteroutputstreambuf.cc
#mv src/inflateinputstreambuf.cpp src/inflateinputstreambuf.cc
#mv src/zipfile.cpp src/zipfile.cc
#mv src/ziphead.cpp src/ziphead.cc
#mv src/zipheadio.cpp src/zipheadio.cc
#mv src/zipinputstream.cpp src/zipinputstream.cc
#mv src/zipinputstreambuf.cpp src/zipinputstreambuf.cc
#mv src/zipoutputstream.cpp src/zipoutputstream.cc
#mv src/zipoutputstreambuf.cpp src/zipoutputstreambuf.cc
cp $HEPREP/c++/include/*.h include/ref
cp $HEPREP/include/HEPREP/*.h include/HEPREP
cp $HEPREP/c++/*.cc src
rm src/MultiWriteTest.cc
rm src/HepRepTest.cc
rm src/HepRepExample.cc
#rm src/test_zipoutputstream.cpp
#rm src/test_gzipoutputstream.cpp
@@ -1,14 +0,0 @@
set HEPREP=%FREEHEP%\hep\graphics\heprep
copy "%FREEHEP%\org\freehep\jni\FreeHepTypes.h" "include\ref"
REM copy "%FREEHEP%\org\freehep\zip\zipios++\*.h" "include\zipios++"
REM copy "%FREEHEP%\org\freehep\zip\*.h" "include\zipios++"
REM copy "%FREEHEP%\org\freehep\zip\*.cpp" "src\*.cc"
copy "%HEPREP%\c++\include\*.h" "include\ref"
copy "%HEPREP%\include\HEPREP\*.h" "include\HEPREP"
copy "%HEPREP%\c++\*.cc" "src"
REM del src\appendzip.cc
del src\MultiWriteTest.cc
del src\HepRepTest.cc
del src\HepRepExample.cc
REM del src\test_zipoutputstream.cc
REM del src\test_gzipoutputstream.cc
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4HepRep.hh,v 1.16 2003/12/11 21:55:54 duns Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
/**
@@ -22,7 +22,7 @@
//
//
// $Id: G4HepRepFile.hh,v 1.7 2003/07/12 19:48:15 duns Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4HepRepFileSceneHandler.hh,v 1.15 2004/11/11 16:01:39 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4HepRepFileSceneHandler.hh,v 1.22 2005/06/02 17:43:46 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// Joseph Perl 27th January 2002
@@ -62,22 +62,22 @@ public:
////////////////////////////////////////////////////////////////
// No need to implement these, but if you do...
void AddThis(const G4Box&);
void AddThis(const G4Cons&);
void AddThis(const G4Tubs&);
void AddThis(const G4Trd&);
void AddThis(const G4Trap&);
void AddThis(const G4Sphere&);
void AddThis(const G4Para&);
void AddThis(const G4Torus&);
void AddThis(const G4Polycone&);
void AddThis(const G4Polyhedra&);
void AddThis(const G4VSolid&);
void AddThis (const G4VTrajectory&);
void AddThis (const G4VHit&);
// void PreAddThis(const G4Transform3D& objectTransformation,
void AddSolid(const G4Box&);
void AddSolid(const G4Cons&);
void AddSolid(const G4Tubs&);
void AddSolid(const G4Trd&);
void AddSolid(const G4Trap&);
void AddSolid(const G4Sphere&);
void AddSolid(const G4Para&);
void AddSolid(const G4Torus&);
void AddSolid(const G4Polycone&);
void AddSolid(const G4Polyhedra&);
void AddSolid(const G4VSolid&);
void AddCompound (const G4VTrajectory&);
void AddCompound (const G4VHit&);
// void PreAddSolid(const G4Transform3D& objectTransformation,
// const G4VisAttributes&);
// void PostAddThis();
// void PostAddSolid();
////////////////////////////////////////////////////////////////
// Required implementation of pure virtual functions...
@@ -117,13 +117,10 @@ public:
////////////////////////////////////////////////////////////////
// Required...
static G4int GetSceneCount() {return fSceneCount;}
G4HepRepFileXMLWriter *GetHepRepXMLWriter();
protected:
static G4int fSceneIdCount; // Counter for HepRep scene handlers.
static G4int fSceneCount; // No. of extanct scene handlers.
private:
G4HepRepFileXMLWriter *hepRepXMLWriter;
@@ -131,6 +128,13 @@ private:
const G4Visible visible);
void CheckFileOpen();
int fileCounter;
char fileDir[256];
char fileName[256];
G4bool fileOverwrite;
G4bool cullInvisibleObjects;
G4bool haveVisible;
G4bool drawingTraj;
G4bool drawingHit;
#ifdef G4HEPREPFILEDEBUG
void PrintThings();
@@ -22,7 +22,7 @@
//
//
// $Id: G4HepRepFileViewer.hh,v 1.8 2003/07/12 19:48:15 duns Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison 5th April 2001
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4HepRepMessenger.hh,v 1.5 2004/05/27 05:55:19 duns Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4HepRepMessenger.hh,v 1.6 2005/06/02 19:15:21 duns Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
#ifndef G4HepRepMessenger_HH
@@ -45,8 +45,8 @@ class G4HepRepMessenger : public G4UImessenger {
virtual G4String getEventNumberSuffix();
virtual G4bool appendGeometry();
virtual G4bool addPointAttributes();
virtual G4String getCoordinateSystem();
virtual G4bool useSolids();
virtual G4bool writeInvisibles();
private:
G4UIdirectory* heprepDirectory;
@@ -60,8 +60,11 @@ class G4HepRepMessenger : public G4UImessenger {
G4bool pointAttributes;
G4UIcmdWithABool* addPointAttributesCommand;
G4String coordinateSystem;
G4UIcmdWithAString* setCoordinateSystemCommand;
G4bool solids;
G4UIcmdWithABool* useSolidsCommand;
G4bool invisibles;
G4UIcmdWithABool* writeInvisiblesCommand;
};
#endif
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4HepRepSceneHandler.hh,v 1.33 2004/11/11 16:01:51 johna Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// $Id: G4HepRepSceneHandler.hh,v 1.40 2005/06/02 23:40:49 duns Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
/**
@@ -41,6 +41,17 @@
#include "HEPREP/HepRep.h"
//G4
#include "G4Box.hh"
#include "G4Cons.hh"
#include "G4Tubs.hh"
#include "G4Trd.hh"
#include "G4Trap.hh"
#include "G4Sphere.hh"
#include "G4Para.hh"
#include "G4Torus.hh"
#include "G4Polycone.hh"
#include "G4Polyhedra.hh"
#include "G4VGraphicsSystem.hh"
#include "G4VSceneHandler.hh"
#include "G4Visible.hh"
@@ -56,22 +67,23 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
G4HepRepSceneHandler (G4VGraphicsSystem& system, G4HepRepMessenger& messenger, const G4String& name = "");
virtual ~G4HepRepSceneHandler ();
void AddThis (const G4Box& box) { G4VSceneHandler::AddThis (box); }
void AddThis (const G4Cons& cons) { G4VSceneHandler::AddThis (cons); }
void AddThis (const G4Tubs& tubs) { G4VSceneHandler::AddThis (tubs); }
void AddThis (const G4Trd& trd) { G4VSceneHandler::AddThis (trd); }
void AddThis (const G4Trap& trap) { G4VSceneHandler::AddThis (trap); }
void AddThis (const G4Sphere& sphere) { G4VSceneHandler::AddThis (sphere); }
void AddThis (const G4Para& para) { G4VSceneHandler::AddThis (para); }
void AddThis (const G4Torus& torus) { G4VSceneHandler::AddThis (torus); }
void AddThis (const G4Polycone& polycone) { G4VSceneHandler::AddThis (polycone); }
void AddThis (const G4Polyhedra& polyhedra) { G4VSceneHandler::AddThis (polyhedra); }
void AddThis (const G4VSolid& solid) { G4VSceneHandler::AddThis(solid); }
void AddThis (const G4VTrajectory&);
void AddThis (const G4VHit& hit) { G4VSceneHandler::AddThis(hit); }
void AddSolid (const G4Box& box);
void AddSolid (const G4Cons& cons);
void AddSolid (const G4Tubs& tubs);
void AddSolid (const G4Trd& trd);
void AddSolid (const G4Trap& trap);
void AddSolid (const G4Sphere& sphere);
void AddSolid (const G4Para& para);
void AddSolid (const G4Torus& torus);
void AddSolid (const G4Polycone& polycone);
void AddSolid (const G4Polyhedra& polyhedra);
void AddSolid (const G4VSolid& solid);
void AddCompound (const G4VTrajectory&);
void AddCompound (const G4VHit& hit);
void PreAddThis (const G4Transform3D& objectTransformation, const G4VisAttributes& visAttribs);
void PostAddThis ();
void PreAddSolid (const G4Transform3D& objectTransformation, const G4VisAttributes& visAttribs);
void PostAddSolid ();
void AddPrimitive (const G4Polyline&);
void AddPrimitive (const G4Text&);
@@ -81,22 +93,20 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
void AddPrimitive (const G4NURBS&);
void AddPrimitive (const G4Polymarker&);
void AddPrimitive (const G4Scale& scale) { G4VSceneHandler::AddPrimitive(scale); }
void AddPrimitive (const G4Scale& scale);
void BeginPrimitives (const G4Transform3D& objectTransformation);
void EndPrimitives ();
void BeginModeling ();
void EndModeling ();
static G4int getSceneCount () { return sceneCount; }
void openHepRep();
bool closeHepRep(bool final = false);
void openFile(G4String name);
void closeFile();
private:
static G4int sceneCount;
static G4int sceneIdCount;
const G4ModelingParameters* originalMP; // Keeps pointer to original.
G4ModelingParameters* nonCullingMP; // For temporary non-culling.
@@ -107,31 +117,46 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
HEPREP::HepRepWriter* writer;
// Methods
G4bool dontWrite();
void setColor (HEPREP::HepRepAttribute *attribute, const G4Color& color,
const G4String& key = G4String("Color"));
G4Color getColor (G4double charge);
G4Color getColorFor (const G4Visible& visible);
G4Color getColorFor (const G4VSolid& solid);
void setVisibility (HEPREP::HepRepAttribute *attribute, const G4VSolid& solid);
void setLine (HEPREP::HepRepAttribute *attribute, const G4VSolid& solid);
void setVisibility (HEPREP::HepRepAttribute *attribute, const G4Visible& visible);
void setLine (HEPREP::HepRepAttribute *attribute, const G4Visible& visible);
void setMarker (HEPREP::HepRepAttribute *attribute, const G4VMarker& marker);
inline void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, char* value) {
setAttribute(attribute, name, G4String(value));
}
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, G4String value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, bool value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, double value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, int value);
void setAttribute (HEPREP::HepRepAttribute* attribute, G4String name, double red, double green, double blue, double alpha);
bool isEventData ();
bool isEventData();
void open(G4String name);
void close();
void writeLayers(HEPREP::HepRep* heprep);
void addAttributes(HEPREP::HepRepInstance* instance, HEPREP::HepRepType* type);
void addAttDefs(HEPREP::HepRepDefinition* definition, const std::map<G4String,G4AttDef>* attDefs);
void addAttVals(HEPREP::HepRepAttribute* attribute, const std::map<G4String,G4AttDef>* attDefs, std::vector<G4AttValue>* attValues);
void addTopLevelAttributes(HEPREP::HepRepType* type);
HEPREP::HepRepInstance* getGeometryOrEventInstance(HEPREP::HepRepType* type);
// Returns the particular instance/type or if not created, creates them and adds them to the HepRep
HEPREP::HepRep* getHepRep();
HEPREP::HepRep* getHepRepGeometry();
@@ -166,7 +191,12 @@ class G4HepRepSceneHandler: public G4VSceneHandler {
G4int eventNumber;
G4int eventNumberWidth;
G4String extension;
G4bool writeBinary;
G4bool writeZip;
G4bool writeGZ;
G4bool writeMultipleFiles;
const G4VHit* currentHit;
const G4VTrajectory* currentTrack;
// DO NOT USE member vars directly, use get methods.
HEPREP::HepRep* _heprep;
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4HepRepViewer.hh,v 1.17 2004/05/27 05:55:20 duns Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
// GEANT4 tag $Name: geant4-07-01 $
//
/**
@@ -1,34 +1,34 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HASHEPREP_H
#define HEPREP_HASHEPREP_H 1
// Copyright 2000-2003, FreeHEP.
namespace HEPREP {
class HepRep;
/**
* The HasHepRep interface.
*
* @author Mark Donszelmann
*/
class HasHepRep {
public:
/// Destructor.
virtual ~HasHepRep() { /* nop */; }
/**
* Returns the associated HepRep to this object.
*
*/
virtual HepRep & getHepRep() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HASHEPREP_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HASHEPREP_H
#define HEPREP_HASHEPREP_H 1
// Copyright 2000-2005, FreeHEP.
namespace HEPREP {
class HepRep;
/**
* The HasHepRep interface.
*
* @author Mark Donszelmann
*/
class HasHepRep {
public:
/// Destructor.
virtual ~HasHepRep() { /* nop */; }
/**
* Returns the associated HepRep to this object.
*
*/
virtual HepRep & getHepRep() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HASHEPREP_H */
@@ -1,210 +1,210 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREP_H
#define HEPREP_HEPREP_H 1
// Copyright 2000-2004, FreeHEP.
#include <string>
#include <vector>
// Include all other HepRep header files here for convenience
#include "HEPREP/HasHepRep.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttribute.h"
#include "HEPREP/HepRepAttributeListener.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepConstants.h"
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepFrameListener.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepIterator.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepWriter.h"
namespace HEPREP {
class HepRepAction;
class HepRepInstanceTree;
class HepRepSelectFilter;
class HepRepTypeTree;
/**
* The HepRep interface.
*
* Any of these methods may throw a UnsupportedOperationException in Java.
*
* This interface is NOT final yet.
*
* @author Mark Donszelmann
*/
class HepRep {
public:
/// Destructor.
virtual ~HepRep() { /* nop */; }
/**
* Add a layer to the list of layers in this heprep.
* The layer is added to the back of the list.
*
* @param layer name of layer to be added to the back of the list.
*/
virtual void addLayer(std::string layer) = 0;
/**
* Returns the list of layers.
*
* @return the known layer names, in the order back-to-front.
*/
virtual std::vector<std::string> getLayerOrder() = 0;
/**
* Add a typetree to this heprep.
*
* @param typeTree to be added.
*/
virtual void addTypeTree(HepRepTypeTree * typeTree) = 0;
/**
* Remove a typetree from this heprep.
*
* @param typeTree to be removed.
*/
virtual void removeTypeTree(HepRepTypeTree * typeTree) = 0;
/**
* Returns the collection of all typetrees of this heprep.
*
* @return collection of HepRepTypeTrees.
*/
virtual std::vector<HepRepTypeTree *> getTypeTreeList() = 0;
/**
* Returns a named and versioned typetree.
*
* @param name name of the typetree.
* @param version version of the typetree.
* @return named and versioned HepRepTypeTree.
*/
virtual HepRepTypeTree * getTypeTree(std::string name, std::string version) = 0;
/**
* Searches for a named type in any of the typetrees.
* The first occurrence found is returned.
*
* @param name name of type.
* @return named HepRepType.
*/
// HepRepType* getType(String name);
/**
* Adds an instancetree to this heprep.
*
* @param instanceTree to be added.
*/
virtual void addInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Overlays an instancetree to this heprep, overriding attributes and adding children.
*
* @param instanceTree to be overlaid.
*/
virtual void overlayInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Remove an instanectree from this heprep.
*
* @param instanceTree to be removed.
*/
virtual void removeInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Returns a collection of instancetrees.
*
* @return collection of HepRepInstanceTrees.
*/
virtual std::vector<HepRepInstanceTree *> getInstanceTreeList() = 0;
/**
* Returns a named and versioned instancetree.
* FIXME: doc is incorrect here, should only return TOP of the tree. Filling
* in should be done by getInstances calls.
* <p>
* This tree needs to be added to the heprep afterwards.
*
* @param name name of the instancetree.
* @param version version of the instancetree.
* @return HepRepIntanceTree
*/
virtual HepRepInstanceTree * getInstanceTreeTop(std::string name, std::string version) = 0;
/**
* Returns a named and versioned instancetree for a list of typenames.
* <p>
* This tree needs to be added to the heprep afterwards.
*
* @param name name of the instancetree.
* @param version version of the instancetree.
* @param typeNames a list of typenames for which we need instancetrees.
* @return HepRepIntanceTree
*/
virtual HepRepInstanceTree * getInstances(std::string name, std::string version, std::vector<std::string> typeNames) = 0;
/**
* Returns a named and versioned instancetree for a list of typenames
* after executing some action and for specific filters.
*
* This tree needs to be added to the heprep afterwards.
* <p>
* The inversion effect of invertAtts depends on the values of
* GetDrawAtts and GetNonDrawAtts as follows:
* <UL>
* <LI>GetDrawAtts GetNonDrawAtts effect of InvertAtts
* <LI>FALSE FALSE all Attributes specified will be downloaded
* <LI>TRUE FALSE Draw Attributes specified will be omitted, NonDraw Attributes specified will be included
* <LI>FALSE TRUE Draw Attributes specified will be included, NonDraw Attributes specified will be omitted
* <LI>TRUE TRUE all Attributes specified will be omitted
* </UL>
*
* @param name name of the instancetree.
* @param version version of the instancetree.
* @param typeNames a list of typenames for which we need instancetrees.
* @param actions execute this list of actions before returning.
* @param getPoints include the HepRepPoints in the instance tree.
* @param getDrawAtts include the Draw attributes in the instance tree.
* @param getNonDrawAtts include the Non-Draw attributes in the instance tree.
* @param invertAtts list of attributes to be included or not depending on getDrawAtts and getNonDrawAtts.
* @return HepRepIntanceTree
*/
virtual HepRepInstanceTree * getInstancesAfterAction(std::string name, std::string version, std::vector<std::string> typeNames, std::vector<HepRepAction *> actions, bool getPoints, bool getDrawAtts, bool getNonDrawAtts, std::vector<std::string> invertAtts) = 0;
/**
* Returns last exception thrown and clears it. Useful for implementations without
* exception handling.
*
* @return last exception and clears it.
*/
virtual std::string checkForException() = 0;
/**
* Returns a deep copy of the heprep, with all its attached trees, where
* instances are filtered using a HepRepSelectFilter.
*
* @param filter to be used for filtering instances.
* @return copy of heprep.
*/
virtual HepRep * copy(HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREP_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREP_H
#define HEPREP_HEPREP_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
#include <vector>
// Include all other HepRep header files here for convenience
#include "HEPREP/HasHepRep.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttribute.h"
#include "HEPREP/HepRepAttributeListener.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepConstants.h"
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepFrameListener.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepIterator.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepWriter.h"
namespace HEPREP {
class HepRepAction;
class HepRepInstanceTree;
class HepRepSelectFilter;
class HepRepTypeTree;
/**
* The HepRep interface.
*
* Any of these methods may throw a UnsupportedOperationException in Java.
*
* This interface is NOT final yet.
*
* @author Mark Donszelmann
*/
class HepRep {
public:
/// Destructor.
virtual ~HepRep() { /* nop */; }
/**
* Add a layer to the list of layers in this heprep.
* The layer is added to the back of the list.
*
* @param layer name of layer to be added to the back of the list.
*/
virtual void addLayer(std::string layer) = 0;
/**
* Returns the list of layers.
*
* @return the known layer names, in the order back-to-front.
*/
virtual std::vector<std::string> getLayerOrder() = 0;
/**
* Add a typetree to this heprep.
*
* @param typeTree to be added.
*/
virtual void addTypeTree(HepRepTypeTree * typeTree) = 0;
/**
* Remove a typetree from this heprep.
*
* @param typeTree to be removed.
*/
virtual void removeTypeTree(HepRepTypeTree * typeTree) = 0;
/**
* Returns the collection of all typetrees of this heprep.
*
* @return collection of HepRepTypeTrees.
*/
virtual std::vector<HepRepTypeTree *> getTypeTreeList() = 0;
/**
* Returns a named and versioned typetree.
*
* @param name name of the typetree.
* @param version version of the typetree.
* @return named and versioned HepRepTypeTree.
*/
virtual HepRepTypeTree * getTypeTree(std::string name, std::string version) = 0;
/**
* Searches for a named type in any of the typetrees.
* The first occurrence found is returned.
*
* @param name name of type.
* @return named HepRepType.
*/
// HepRepType* getType(String name);
/**
* Adds an instancetree to this heprep.
*
* @param instanceTree to be added.
*/
virtual void addInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Overlays an instancetree to this heprep, overriding attributes and adding children.
*
* @param instanceTree to be overlaid.
*/
virtual void overlayInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Remove an instanectree from this heprep.
*
* @param instanceTree to be removed.
*/
virtual void removeInstanceTree(HepRepInstanceTree * instanceTree) = 0;
/**
* Returns a collection of instancetrees.
*
* @return collection of HepRepInstanceTrees.
*/
virtual std::vector<HepRepInstanceTree *> getInstanceTreeList() = 0;
/**
* Returns a named and versioned instancetree.
* FIXME: doc is incorrect here, should only return TOP of the tree. Filling
* in should be done by getInstances calls.
* <p>
* This tree needs to be added to the heprep afterwards.
*
* @param name name of the instancetree.
* @param version version of the instancetree.
* @return HepRepIntanceTree
*/
virtual HepRepInstanceTree * getInstanceTreeTop(std::string name, std::string version) = 0;
/**
* Returns a named and versioned instancetree for a list of typenames.
* <p>
* This tree needs to be added to the heprep afterwards.
*
* @param name name of the instancetree.
* @param version version of the instancetree.
* @param typeNames a list of typenames for which we need instancetrees.
* @return HepRepIntanceTree
*/
virtual HepRepInstanceTree * getInstances(std::string name, std::string version, std::vector<std::string> typeNames) = 0;
/**
* Returns a named and versioned instancetree for a list of typenames
* after executing some action and for specific filters.
*
* This tree needs to be added to the heprep afterwards.
* <p>
* The inversion effect of invertAtts depends on the values of
* GetDrawAtts and GetNonDrawAtts as follows:
* <UL>
* <LI>GetDrawAtts GetNonDrawAtts effect of InvertAtts
* <LI>FALSE FALSE all Attributes specified will be downloaded
* <LI>TRUE FALSE Draw Attributes specified will be omitted, NonDraw Attributes specified will be included
* <LI>FALSE TRUE Draw Attributes specified will be included, NonDraw Attributes specified will be omitted
* <LI>TRUE TRUE all Attributes specified will be omitted
* </UL>
*
* @param name name of the instancetree.
* @param version version of the instancetree.
* @param typeNames a list of typenames for which we need instancetrees.
* @param actions execute this list of actions before returning.
* @param getPoints include the HepRepPoints in the instance tree.
* @param getDrawAtts include the Draw attributes in the instance tree.
* @param getNonDrawAtts include the Non-Draw attributes in the instance tree.
* @param invertAtts list of attributes to be included or not depending on getDrawAtts and getNonDrawAtts.
* @return HepRepIntanceTree
*/
virtual HepRepInstanceTree * getInstancesAfterAction(std::string name, std::string version, std::vector<std::string> typeNames, std::vector<HepRepAction *> actions, bool getPoints, bool getDrawAtts, bool getNonDrawAtts, std::vector<std::string> invertAtts) = 0;
/**
* Returns last exception thrown and clears it. Useful for implementations without
* exception handling.
*
* @return last exception and clears it.
*/
virtual std::string checkForException() = 0;
/**
* Returns a deep copy of the heprep, with all its attached trees, where
* instances are filtered using a HepRepSelectFilter.
*
* @param filter to be used for filtering instances.
* @return copy of heprep.
*/
virtual HepRep * copy(HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREP_H */
@@ -1,49 +1,49 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPACTION_H
#define HEPREP_HEPREPACTION_H 1
// Copyright 2000-2002, FreeHEP.
#include <string>
namespace HEPREP {
/**
* HepRepAction interface.
*
* @author Mark Donszelmann
*/
class HepRepAction {
public:
/// Destructor.
virtual ~HepRepAction() { /* nop */; }
/**
* Returns name of this action.
*
* @return name of this action.
*/
virtual std::string getName() = 0;
/**
* Returns expression associated with this action.
*
* @return expression of this action.
*/
virtual std::string getExpression() = 0;
/**
* Returns a deep copy of this action.
*
* @return copy of this action.
*/
virtual HepRepAction * copy() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPACTION_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPACTION_H
#define HEPREP_HEPREPACTION_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
namespace HEPREP {
/**
* HepRepAction interface.
*
* @author Mark Donszelmann
*/
class HepRepAction {
public:
/// Destructor.
virtual ~HepRepAction() { /* nop */; }
/**
* Returns name of this action.
*
* @return name of this action.
*/
virtual std::string getName() = 0;
/**
* Returns expression associated with this action.
*
* @return expression of this action.
*/
virtual std::string getExpression() = 0;
/**
* Returns a deep copy of this action.
*
* @return copy of this action.
*/
virtual HepRepAction * copy() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPACTION_H */
@@ -1,70 +1,70 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTDEF_H
#define HEPREP_HEPREPATTDEF_H 1
// Copyright 2000-2002, FreeHEP.
#include <string>
namespace HEPREP {
/**
* HepRepAttDef interface.
*
* @author Mark Donszelmann
*/
class HepRepAttDef {
public:
/// Destructor.
virtual ~HepRepAttDef() { /* nop */; }
/**
* Returns the mixed case name of this attdef.
*
* @return name.
*/
virtual std::string getName() = 0;
/**
* Returns the lowercased name of this attdef.
*
* @return lowercased name.
*/
virtual std::string getLowerCaseName() = 0;
/**
* Returns a description of this attdef.
*
* @return description.
*/
virtual std::string getDescription() = 0;
/**
* Returns category of this attdef.
*
* @return category.
*/
virtual std::string getCategory() = 0;
/**
* Returns any extra information of this attdef.
*
* @return extra info.
*/
virtual std::string getExtra() = 0;
/**
* Returns a deep copy of this attdef.
*
* @return copy of this attdef.
*/
virtual HepRepAttDef * copy() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTDEF_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTDEF_H
#define HEPREP_HEPREPATTDEF_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
namespace HEPREP {
/**
* HepRepAttDef interface.
*
* @author Mark Donszelmann
*/
class HepRepAttDef {
public:
/// Destructor.
virtual ~HepRepAttDef() { /* nop */; }
/**
* Returns the mixed case name of this attdef.
*
* @return name.
*/
virtual std::string getName() = 0;
/**
* Returns the lowercased name of this attdef.
*
* @return lowercased name.
*/
virtual std::string getLowerCaseName() = 0;
/**
* Returns a description of this attdef.
*
* @return description.
*/
virtual std::string getDescription() = 0;
/**
* Returns category of this attdef.
*
* @return category.
*/
virtual std::string getCategory() = 0;
/**
* Returns any extra information of this attdef.
*
* @return extra info.
*/
virtual std::string getExtra() = 0;
/**
* Returns a deep copy of this attdef.
*
* @return copy of this attdef.
*/
virtual HepRepAttDef * copy() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTDEF_H */
@@ -1,127 +1,129 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTVALUE_H
#define HEPREP_HEPREPATTVALUE_H 1
// Copyright 2000-2002, FreeHEP.
#include <string>
#include <vector>
namespace HEPREP {
/**
* HepRepAttValue interface.
*
* @author Mark Donszelmann
*/
class HepRepAttValue {
public:
/// Destructor.
virtual ~HepRepAttValue() { /* nop */; }
/**
* Returns name of the attvalue.
*
* @return Capitalized Name.
*/
virtual std::string getName() = 0;
/**
* Returns lowercased name of the attvalue.
*
* @return Lowercased Name.
*/
virtual std::string getLowerCaseName() = 0;
/**
* Returns type of the attvalue, defined in HepRepConstants with names TYPE_xxx.
*
* @return type.
*/
virtual int getType() = 0;
/**
* Returns the Java-like name for the type of this attvalue.
*
* @return type name.
*/
virtual std::string getTypeName() = 0;
/**
* Returns the flag bits for showing this attvalue as a label, defined in HepRepConstants with names SHOW_xxx.
*
* @return flag bits if should be shown as label.
*/
virtual int showLabel() = 0;
/**
* Returns value as string.
*
* @return value as string (if type is string).
*/
virtual std::string getString() = 0;
/**
* Returns value as lowercase string.
*
* @return value as string (if type is string).
*/
virtual std::string getLowerCaseString() = 0;
/**
* Returns value as string.
*
* @return value (of any type) in string format.
*/
virtual std::string getAsString() = 0;
/**
* Returns value as Color.
*
* @return value as Color.
*/
virtual std::vector<double> getColor() = 0;
/**
* Returns value as long.
*
* @return value as long.
*/
virtual long getLong() = 0;
/**
* Returns value as int.
*
* @return value as integer.
*/
virtual int getInteger() = 0;
/**
* Returns value as double.
*
* @return value as double.
*/
virtual double getDouble() = 0;
/**
* Returns value as boolean.
*
* @return value as boolean.
*/
virtual bool getBoolean() = 0;
/**
* Returns a deep copy of this attvalue.
*
* @return copy of this attvalue.
*/
virtual HepRepAttValue * copy() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTVALUE_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTVALUE_H
#define HEPREP_HEPREPATTVALUE_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
#include <vector>
#include "HEPREP/Types.h"
namespace HEPREP {
/**
* HepRepAttValue interface.
*
* @author Mark Donszelmann
*/
class HepRepAttValue {
public:
/// Destructor.
virtual ~HepRepAttValue() { /* nop */; }
/**
* Returns name of the attvalue.
*
* @return Capitalized Name.
*/
virtual std::string getName() = 0;
/**
* Returns lowercased name of the attvalue.
*
* @return Lowercased Name.
*/
virtual std::string getLowerCaseName() = 0;
/**
* Returns type of the attvalue, defined in HepRepConstants with names TYPE_xxx.
*
* @return type.
*/
virtual int getType() = 0;
/**
* Returns the Java-like name for the type of this attvalue.
*
* @return type name.
*/
virtual std::string getTypeName() = 0;
/**
* Returns the flag bits for showing this attvalue as a label, defined in HepRepConstants with names SHOW_xxx.
*
* @return flag bits if should be shown as label.
*/
virtual int showLabel() = 0;
/**
* Returns value as string.
*
* @return value as string (if type is string).
*/
virtual std::string getString() = 0;
/**
* Returns value as lowercase string.
*
* @return value as string (if type is string).
*/
virtual std::string getLowerCaseString() = 0;
/**
* Returns value as string.
*
* @return value (of any type) in string format.
*/
virtual std::string getAsString() = 0;
/**
* Returns value as Color.
*
* @return value as Color.
*/
virtual std::vector<double> getColor() = 0;
/**
* Returns value as long.
*
* @return value as long.
*/
virtual int64 getLong() = 0;
/**
* Returns value as int.
*
* @return value as integer.
*/
virtual int getInteger() = 0;
/**
* Returns value as double.
*
* @return value as double.
*/
virtual double getDouble() = 0;
/**
* Returns value as boolean.
*
* @return value as boolean.
*/
virtual bool getBoolean() = 0;
/**
* Returns a deep copy of this attvalue.
*
* @return copy of this attvalue.
*/
virtual HepRepAttValue * copy() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTVALUE_H */
@@ -1,142 +1,153 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTRIBUTE_H
#define HEPREP_HEPREPATTRIBUTE_H 1
// Copyright 2000-2002, FreeHEP.
#include <set>
#include <string>
#include <vector>
#include "HEPREP/HepRepConstants.h"
namespace HEPREP {
class HepRepAttValue;
/**
* HepRepAttribute interface.
*
* @author Mark Donszelmann
*/
class HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepAttribute() { /* nop */; }
/**
* Adds an attValue.
*
* @param attValue to be added.
*/
virtual void addAttValue(HepRepAttValue * attValue) = 0;
/**
* Adds a char* attValue as a String.
* This call should be mapped to addAttValue(std::string, std::string, int); and necessary
* because C++ converts char* into bool and would thus call addAttValue(std::string, bool, int)
* for a call such as addAttValue("drawAs", "Cylinder", 0);
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, char* value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, std::string value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, int value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, double value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, bool value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds a Color attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, std::vector<double> value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds a Color attValue.
*
* @param key name of attValue
* @param red color
* @param green color
* @param blue color
* @param alpha value
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, double red, double green, double blue, double alpha = 1.0, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Remove the attvalue named by key.
*
* @param key name of the attValue to be removed.
* @return removed HepRepAttValue, or null if not removed.
*/
virtual HepRepAttValue * removeAttValue(std::string key) = 0;
/**
* Returns the attValue specified by name. This attValue is normally searched
* on the node itself and then on its type, moving up the typetree.
*
* @param name of attribute value.
* @return attribute value.
*/
virtual HepRepAttValue * getAttValue(std::string name) = 0;
/**
* Returns a collection of all attribute values from this node.
*
* @return collection of HepRepAttValues.
*/
virtual std::set<HepRepAttValue *> getAttValuesFromNode() = 0;
/**
* Returns a named attribute value from this node.
*
* @param lowerCaseName name in all lowercase.
* @return corresponding HepRepAttValue.
*/
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTRIBUTE_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTRIBUTE_H
#define HEPREP_HEPREPATTRIBUTE_H 1
// Copyright 2000-2005, FreeHEP.
#include <set>
#include <string>
#include <vector>
#include "HEPREP/Types.h"
#include "HEPREP/HepRepConstants.h"
namespace HEPREP {
class HepRepAttValue;
/**
* HepRepAttribute interface.
*
* @author Mark Donszelmann
*/
class HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepAttribute() { /* nop */; }
/**
* Adds an attValue.
*
* @param attValue to be added.
*/
virtual void addAttValue(HepRepAttValue * attValue) = 0;
/**
* Adds a char* attValue as a String.
* This call should be mapped to addAttValue(std::string, std::string, int); and necessary
* because C++ converts char* into bool and would thus call addAttValue(std::string, bool, int)
* for a call such as addAttValue("drawAs", "Cylinder", 0);
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, char* value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, std::string value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, int64 value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, int value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, double value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds an attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, bool value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds a Color attValue.
*
* @param key name of attValue
* @param value value of attValue
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, std::vector<double> value, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Adds a Color attValue.
*
* @param key name of attValue
* @param red color
* @param green color
* @param blue color
* @param alpha value
* @param showLabel show this as label
*/
virtual void addAttValue(std::string key, double red, double green, double blue, double alpha = 1.0, int showLabel = HepRepConstants::SHOW_NONE) = 0;
/**
* Remove the attvalue named by key.
*
* @param key name of the attValue to be removed.
* @return removed HepRepAttValue, or null if not removed.
*/
virtual HepRepAttValue * removeAttValue(std::string key) = 0;
/**
* Returns the attValue specified by name. This attValue is normally searched
* on the node itself and then on its type, moving up the typetree.
*
* @param name of attribute value.
* @return attribute value.
*/
virtual HepRepAttValue * getAttValue(std::string name) = 0;
/**
* Returns a collection of all attribute values from this node.
*
* @return collection of HepRepAttValues.
*/
virtual std::set<HepRepAttValue *> getAttValuesFromNode() = 0;
/**
* Returns a named attribute value from this node.
*
* @param lowerCaseName name in all lowercase.
* @return corresponding HepRepAttValue.
*/
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTRIBUTE_H */
@@ -1,103 +1,103 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTRIBUTELISTENER_H
#define HEPREP_HEPREPATTRIBUTELISTENER_H 1
// Copyright 2000-2004, FreeHEP.
#include <string>
#include <vector>
namespace HEPREP {
class HepRepInstance;
/**
* HepRepAttributeListener interface. The implementor is called back for changes
* of attributes while using the HepRepIterator to iterate over all the HepRepInstances.
*
* All names are lowercased.
*
* @author Mark Donszelmann
*/
class HepRepAttributeListener {
public:
/// Destructor.
virtual ~HepRepAttributeListener() { /* nop */; }
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param lowerCaseValue lower case value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, std::string value, std::string lowerCaseValue, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, std::vector<double> value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, long value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, int value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, double value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, bool value, int showLabel) = 0;
/**
* Called if attribute key is removed from the attribute set.
*
* @param instance instance for which this attribute is set.
* @param key name of the removed attribute.
*/
virtual void removeAttribute(HepRepInstance * instance, std::string key) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTRIBUTELISTENER_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPATTRIBUTELISTENER_H
#define HEPREP_HEPREPATTRIBUTELISTENER_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
#include <vector>
namespace HEPREP {
class HepRepInstance;
/**
* HepRepAttributeListener interface. The implementor is called back for changes
* of attributes while using the HepRepIterator to iterate over all the HepRepInstances.
*
* All names are lowercased.
*
* @author Mark Donszelmann
*/
class HepRepAttributeListener {
public:
/// Destructor.
virtual ~HepRepAttributeListener() { /* nop */; }
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param lowerCaseValue lower case value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, std::string value, std::string lowerCaseValue, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, std::vector<double> value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, long value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, int value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, double value, int showLabel) = 0;
/**
* Called if attribute key changes its value.
*
* @param instance instance for which this attribute is set.
* @param key name of the changed attribute.
* @param value value of the changed attribute.
* @param showLabel value of showLabel.
*/
virtual void setAttribute(HepRepInstance * instance, std::string key, bool value, int showLabel) = 0;
/**
* Called if attribute key is removed from the attribute set.
*
* @param instance instance for which this attribute is set.
* @param key name of the removed attribute.
*/
virtual void removeAttribute(HepRepInstance * instance, std::string key) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPATTRIBUTELISTENER_H */
@@ -1,36 +1,36 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPCONSTANTS_H
#define HEPREP_HEPREPCONSTANTS_H 1
// Copyright 2000, FreeHEP.
namespace HEPREP {
/**
* Constants for HepRep interfaces.
*
* @author Mark Donszelmann
*/
class HepRepConstants {
public:
/// Destructor.
virtual ~HepRepConstants() { /* nop */; }
/**
* Defines constants for type
*/
enum { TYPE_UNKNOWN = -1, TYPE_STRING = 1, TYPE_COLOR = 2, TYPE_LONG = 10, TYPE_INT = 11, TYPE_DOUBLE = 20, TYPE_BOOLEAN = 30 };
/**
* Defines constants for showLabel
*/
enum { SHOW_NONE = 0x0000, SHOW_NAME = 0x0001, SHOW_DESC = 0x0002, SHOW_VALUE = 0x0004, SHOW_EXTRA = 0x0008 };
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPCONSTANTS_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPCONSTANTS_H
#define HEPREP_HEPREPCONSTANTS_H 1
// Copyright 2000-2005, FreeHEP.
namespace HEPREP {
/**
* Constants for HepRep interfaces.
*
* @author Mark Donszelmann
*/
class HepRepConstants {
public:
/// Destructor.
virtual ~HepRepConstants() { /* nop */; }
/**
* Defines constants for type
*/
enum { TYPE_UNKNOWN = -1, TYPE_STRING = 1, TYPE_COLOR = 2, TYPE_LONG = 10, TYPE_INT = 11, TYPE_DOUBLE = 20, TYPE_BOOLEAN = 30 };
/**
* Defines constants for showLabel
*/
enum { SHOW_NONE = 0x0000, SHOW_NAME = 0x0001, SHOW_DESC = 0x0002, SHOW_VALUE = 0x0004, SHOW_EXTRA = 0x0008 };
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPCONSTANTS_H */
@@ -1,74 +1,74 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPDEFINITION_H
#define HEPREP_HEPREPDEFINITION_H 1
// Copyright 2000-2002, FreeHEP.
#include <set>
#include <string>
#include "HEPREP/HepRepAttribute.h"
namespace HEPREP {
class HepRepAttDef;
/**
* HepRepDefinition interface.
*
* @author Mark Donszelmann
*
*/
class HepRepDefinition : virtual public HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepDefinition() { /* nop */; }
/**
* Adds an attdef.
*
* @param name name of the definition.
* @param desc description of the definition.
* @param category category of the definition.
* @param extra extra info of the definition.
*/
virtual void addAttDef(std::string name, std::string desc, std::string category, std::string extra) = 0;
/**
* Adds an attdef.
*
* @param attDef to be added.
*/
virtual void addAttDef(HepRepAttDef * attDef) = 0;
/**
* Return a named attribute definition searched on this node and any parent nodes.
*
* @param name of attribute definition.
* @return attribute definition.
*/
virtual HepRepAttDef * getAttDef(std::string name) = 0;
/**
* Returns a collection of all attribute definitions defined on this node.
*
* @return collection of attributes definitions.
*/
virtual std::set<HepRepAttDef *> getAttDefsFromNode() = 0;
/**
* Returns a named attribute definition defined on this node.
*
* @param lowerCaseName name of the attribute in lower case.
* @return attribute definition.
*/
virtual HepRepAttDef * getAttDefFromNode(std::string lowerCaseName) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPDEFINITION_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPDEFINITION_H
#define HEPREP_HEPREPDEFINITION_H 1
// Copyright 2000-2005, FreeHEP.
#include <set>
#include <string>
#include "HEPREP/HepRepAttribute.h"
namespace HEPREP {
class HepRepAttDef;
/**
* HepRepDefinition interface.
*
* @author Mark Donszelmann
*
*/
class HepRepDefinition : virtual public HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepDefinition() { /* nop */; }
/**
* Adds an attdef.
*
* @param name name of the definition.
* @param desc description of the definition.
* @param category category of the definition.
* @param extra extra info of the definition.
*/
virtual void addAttDef(std::string name, std::string desc, std::string category, std::string extra) = 0;
/**
* Adds an attdef.
*
* @param attDef to be added.
*/
virtual void addAttDef(HepRepAttDef * attDef) = 0;
/**
* Return a named attribute definition searched on this node and any parent nodes.
*
* @param name of attribute definition.
* @return attribute definition.
*/
virtual HepRepAttDef * getAttDef(std::string name) = 0;
/**
* Returns a collection of all attribute definitions defined on this node.
*
* @return collection of attributes definitions.
*/
virtual std::set<HepRepAttDef *> getAttDefsFromNode() = 0;
/**
* Returns a named attribute definition defined on this node.
*
* @param lowerCaseName name of the attribute in lower case.
* @return attribute definition.
*/
virtual HepRepAttDef * getAttDefFromNode(std::string lowerCaseName) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPDEFINITION_H */
@@ -1,148 +1,148 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPFACTORY_H
#define HEPREP_HEPREPFACTORY_H 1
// Copyright 2000-2002, FreeHEP.
#include <iostream>
#include <string>
namespace HEPREP {
class HepRep;
class HepRepAction;
class HepRepInstance;
class HepRepInstanceTree;
class HepRepPoint;
class HepRepReader;
class HepRepTreeID;
class HepRepType;
class HepRepTypeTree;
class HepRepWriter;
/**
* HepRepFactory interface.
*
* @author Mark Donszelmann
*/
class HepRepFactory {
public:
/// Destructor.
virtual ~HepRepFactory() { /* nop */; }
/**
* Creates a HepRepReader from a stream.
*
* @param in input stream.
*/
virtual HepRepReader * createHepRepReader(std::istream * in) = 0;
/**
* Creates a HepRepReader from a file name.
*
* @param inputFileName file name.
*/
virtual HepRepReader * createHepRepReader(std::string inputFileName) = 0;
/**
* Creates a HepRepWriter.
*
* @param out output stream.
* @param randomAccess create a writer in a format that will allow random access (may be ignored).
* @param compress create a writer that uses compression (may be ignored).
*/
virtual HepRepWriter * createHepRepWriter(std::ostream * out, bool randomAccess, bool compress) = 0;
/**
* Creates a HepRepPoint.
*
* @param instance to add the point to.
* @param x x coordinate of point.
* @param y y coordinate of point.
* @param z z coordinate of point.
*/
virtual HepRepPoint * createHepRepPoint(HepRepInstance * instance, double x, double y, double z) = 0;
/**
* Creates a HepRepInstance.
*
* @parent to add the instance to.
* @type type the associated type.
*/
virtual HepRepInstance * createHepRepInstance(HepRepInstance * parent, HepRepType * type) = 0;
/**
* Creates a HepRepInstance.
*
* @parent to add the instance to.
* @type type the associated type.
*/
virtual HepRepInstance * createHepRepInstance(HepRepInstanceTree * parent, HepRepType * type) = 0;
/**
* Creates a HepRepTreeID.
*
* @param name of the treeID.
* @param version of the treeID.
* @param qualifier of the treeID.
*/
virtual HepRepTreeID * createHepRepTreeID(std::string name, std::string version, std::string qualifier = "top-level") = 0;
/**
* Creates a HepRepAction.
*
* @param name of the action.
* @param expression of the action.
*/
virtual HepRepAction * createHepRepAction(std::string name, std::string expression) = 0;
/**
* Creates a HepRepInstanceTree.
* <p>
* The tree needs to be added to the HepRep.
*
* @param name of the instancetree.
* @param version of the instancetree.
* @param typeTree associated typetree.
*/
virtual HepRepInstanceTree * createHepRepInstanceTree(std::string name, std::string version, HepRepTreeID * typeTree) = 0;
/**
* Creates a HepRepType.
*
* @param parent to add this type to.
* @param name of the type to create.
*/
virtual HepRepType * createHepRepType(HepRepTypeTree * parent, std::string name) = 0;
/**
* Creates a HepRepType.
*
* @param parent to add this type to.
* @param name of the type to create.
*/
virtual HepRepType * createHepRepType(HepRepType * parent, std::string name) = 0;
/**
* Creates a HepRepTypeTree.
* <p>
* The tree needs to be added to the HepRep.
*
* @param treeID to name the tree being created.
*/
virtual HepRepTypeTree * createHepRepTypeTree(HepRepTreeID * treeID) = 0;
/**
* Creates a HepRep.
*
*/
virtual HepRep * createHepRep() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPFACTORY_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPFACTORY_H
#define HEPREP_HEPREPFACTORY_H 1
// Copyright 2000-2005, FreeHEP.
#include <iostream>
#include <string>
namespace HEPREP {
class HepRep;
class HepRepAction;
class HepRepInstance;
class HepRepInstanceTree;
class HepRepPoint;
class HepRepReader;
class HepRepTreeID;
class HepRepType;
class HepRepTypeTree;
class HepRepWriter;
/**
* HepRepFactory interface.
*
* @author Mark Donszelmann
*/
class HepRepFactory {
public:
/// Destructor.
virtual ~HepRepFactory() { /* nop */; }
/**
* Creates a HepRepReader from a stream.
*
* @param in input stream.
*/
virtual HepRepReader * createHepRepReader(std::istream * in) = 0;
/**
* Creates a HepRepReader from a file name.
*
* @param inputFileName file name.
*/
virtual HepRepReader * createHepRepReader(std::string inputFileName) = 0;
/**
* Creates a HepRepWriter.
*
* @param out output stream.
* @param randomAccess create a writer in a format that will allow random access (may be ignored).
* @param compress create a writer that uses compression (may be ignored).
*/
virtual HepRepWriter * createHepRepWriter(std::ostream * out, bool randomAccess, bool compress) = 0;
/**
* Creates a HepRepPoint.
*
* @param instance to add the point to.
* @param x x coordinate of point.
* @param y y coordinate of point.
* @param z z coordinate of point.
*/
virtual HepRepPoint * createHepRepPoint(HepRepInstance * instance, double x, double y, double z) = 0;
/**
* Creates a HepRepInstance.
*
* @parent to add the instance to.
* @type type the associated type.
*/
virtual HepRepInstance * createHepRepInstance(HepRepInstance * parent, HepRepType * type) = 0;
/**
* Creates a HepRepInstance.
*
* @parent to add the instance to.
* @type type the associated type.
*/
virtual HepRepInstance * createHepRepInstance(HepRepInstanceTree * parent, HepRepType * type) = 0;
/**
* Creates a HepRepTreeID.
*
* @param name of the treeID.
* @param version of the treeID.
* @param qualifier of the treeID.
*/
virtual HepRepTreeID * createHepRepTreeID(std::string name, std::string version, std::string qualifier = "top-level") = 0;
/**
* Creates a HepRepAction.
*
* @param name of the action.
* @param expression of the action.
*/
virtual HepRepAction * createHepRepAction(std::string name, std::string expression) = 0;
/**
* Creates a HepRepInstanceTree.
* <p>
* The tree needs to be added to the HepRep.
*
* @param name of the instancetree.
* @param version of the instancetree.
* @param typeTree associated typetree.
*/
virtual HepRepInstanceTree * createHepRepInstanceTree(std::string name, std::string version, HepRepTreeID * typeTree) = 0;
/**
* Creates a HepRepType.
*
* @param parent to add this type to.
* @param name of the type to create.
*/
virtual HepRepType * createHepRepType(HepRepTypeTree * parent, std::string name) = 0;
/**
* Creates a HepRepType.
*
* @param parent to add this type to.
* @param name of the type to create.
*/
virtual HepRepType * createHepRepType(HepRepType * parent, std::string name) = 0;
/**
* Creates a HepRepTypeTree.
* <p>
* The tree needs to be added to the HepRep.
*
* @param treeID to name the tree being created.
*/
virtual HepRepTypeTree * createHepRepTypeTree(HepRepTreeID * treeID) = 0;
/**
* Creates a HepRep.
*
*/
virtual HepRep * createHepRep() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPFACTORY_H */
@@ -1,34 +1,34 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPFRAMELISTENER_H
#define HEPREP_HEPREPFRAMELISTENER_H 1
// Copyright 2004, FreeHEP.
namespace HEPREP {
/**
* HepRepFrameListener interface. The implementor is called back for changes in
* drawing in or out of the frame layer.
*
* @author Mark Donszelmann
*/
class HepRepFrameListener {
public:
/// Destructor.
virtual ~HepRepFrameListener() { /* nop */; }
/**
* Called if we switch from a normal layer to a frame layer, and back.
*
* @param inFrame true if in a frame layer
*/
virtual void setFrameLayer(bool inFrame) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPFRAMELISTENER_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPFRAMELISTENER_H
#define HEPREP_HEPREPFRAMELISTENER_H 1
// Copyright 2004-2005, FreeHEP.
namespace HEPREP {
/**
* HepRepFrameListener interface. The implementor is called back for changes in
* drawing in or out of the frame layer.
*
* @author Mark Donszelmann
*/
class HepRepFrameListener {
public:
/// Destructor.
virtual ~HepRepFrameListener() { /* nop */; }
/**
* Called if we switch from a normal layer to a frame layer, and back.
*
* @param inFrame true if in a frame layer
*/
virtual void setFrameLayer(bool inFrame) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPFRAMELISTENER_H */
@@ -1,138 +1,138 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPINSTANCE_H
#define HEPREP_HEPREPINSTANCE_H 1
// Copyright 2000-2004, FreeHEP.
#include <vector>
#include "HEPREP/HepRepAttribute.h"
namespace HEPREP {
class HepRepInstanceTree;
class HepRepPoint;
class HepRepSelectFilter;
class HepRepType;
class HepRepTypeTree;
/**
* HepRepInstance interface.
*
* @author Mark Donszelmann
*/
class HepRepInstance : virtual public HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepInstance() { /* nop */; }
/**
* Overlays the instance on the current instance.
*
* Attributes of the instance override or are added to the current instance.
* Sub-instances of the instance are added only if the current instance has no sub-instances.
* Points of the instance are added only if the current instance has no points.
*/
virtual void overlay(HepRepInstance * instance) = 0;
/**
* Adds an sub-instance to this instance.
*
* @param instance sub-instance.
*/
virtual void addInstance(HepRepInstance * instance) = 0;
/**
* Removes a sub-instance from this instance.
*
* @param instance sub-instance.
*/
virtual void removeInstance(HepRepInstance * instance) = 0;
/**
* Returns a collection of all sub-instances this instance keeps.
*
* @return collection of HepRepInstances.
*/
virtual std::vector<HepRepInstance *> getInstances() = 0;
/**
* Returns the associated type for this instance.
*
* @return associated HepRepType.
*/
virtual HepRepType * getType() = 0;
/**
* Adds a point to this instance.
*
* @param point to be added.
*/
virtual void addPoint(HepRepPoint * point) = 0;
/**
* Returns a collection of all points this instance keeps.
*
* @return collection of HepRepPoints.
*/
virtual std::vector<HepRepPoint *> getPoints() = 0;
/**
* Fills a double[3][n] array with the coordinates of all points, if
* none of the points have any attributes defined on them.
* The actual number of points filled is returned. In case the number
* of points is larger than n, or if any points have attributes, -1 is returned.
* One could then call getPoint().
*
* @see #getPoints()
*
* @param xyz a double[3][n] array to be filled with points.
* @return number of points filled in xyz, or -1 in case of error or non-implementation.
*
* ONLY in JAVA
*/
/**
* Returns true if this instance has a frame. Speedy access for iterator.
*
* ONLY in JAVA
*/
/**
* Returns String layername. Speedy access for iterator.
*
* ONLY in JAVA
*/
/**
* Returns the parent of this instance.
*
* @return parent of instance, or null if top-level.
*/
virtual HepRepInstance * getSuperInstance() = 0;
/**
* Returns a deep copy of this instance.
*
* @param typeTree needed to find the associated type.
* @param parent to which the copy is added.
* @param filter run on all instances before copying.
* @return copy of this instance.
*/
virtual HepRepInstance * copy(HepRepTypeTree * typeTree, HepRepInstance * parent, HepRepSelectFilter * filter = NULL) = 0;
/**
* Returns a deep copy of this instance.
*
* @param typeTree needed to find the associated type.
* @param parent to which the copy is added.
* @param filter run on all instances before copying.
* @return copy of this instance.
*/
virtual HepRepInstance * copy(HepRepTypeTree * typeTree, HepRepInstanceTree * parent, HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCE_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPINSTANCE_H
#define HEPREP_HEPREPINSTANCE_H 1
// Copyright 2000-2005, FreeHEP.
#include <vector>
#include "HEPREP/HepRepAttribute.h"
namespace HEPREP {
class HepRepInstanceTree;
class HepRepPoint;
class HepRepSelectFilter;
class HepRepType;
class HepRepTypeTree;
/**
* HepRepInstance interface.
*
* @author Mark Donszelmann
*/
class HepRepInstance : virtual public HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepInstance() { /* nop */; }
/**
* Overlays the instance on the current instance.
*
* Attributes of the instance override or are added to the current instance.
* Sub-instances of the instance are added only if the current instance has no sub-instances.
* Points of the instance are added only if the current instance has no points.
*/
virtual void overlay(HepRepInstance * instance) = 0;
/**
* Adds an sub-instance to this instance.
*
* @param instance sub-instance.
*/
virtual void addInstance(HepRepInstance * instance) = 0;
/**
* Removes a sub-instance from this instance.
*
* @param instance sub-instance.
*/
virtual void removeInstance(HepRepInstance * instance) = 0;
/**
* Returns a collection of all sub-instances this instance keeps.
*
* @return collection of HepRepInstances.
*/
virtual std::vector<HepRepInstance *> getInstances() = 0;
/**
* Returns the associated type for this instance.
*
* @return associated HepRepType.
*/
virtual HepRepType * getType() = 0;
/**
* Adds a point to this instance.
*
* @param point to be added.
*/
virtual void addPoint(HepRepPoint * point) = 0;
/**
* Returns a collection of all points this instance keeps.
*
* @return collection of HepRepPoints.
*/
virtual std::vector<HepRepPoint *> getPoints() = 0;
/**
* Fills a double[3][n] array with the coordinates of all points, if
* none of the points have any attributes defined on them.
* The actual number of points filled is returned. In case the number
* of points is larger than n, or if any points have attributes, -1 is returned.
* One could then call getPoint().
*
* @see #getPoints()
*
* @param xyz a double[3][n] array to be filled with points.
* @return number of points filled in xyz, or -1 in case of error or non-implementation.
*
* ONLY in JAVA
*/
/**
* Returns true if this instance has a frame. Speedy access for iterator.
*
* ONLY in JAVA
*/
/**
* Returns String layername. Speedy access for iterator.
*
* ONLY in JAVA
*/
/**
* Returns the parent of this instance.
*
* @return parent of instance, or null if top-level.
*/
virtual HepRepInstance * getSuperInstance() = 0;
/**
* Returns a deep copy of this instance.
*
* @param typeTree needed to find the associated type.
* @param parent to which the copy is added.
* @param filter run on all instances before copying.
* @return copy of this instance.
*/
virtual HepRepInstance * copy(HepRepTypeTree * typeTree, HepRepInstance * parent, HepRepSelectFilter * filter = NULL) = 0;
/**
* Returns a deep copy of this instance.
*
* @param typeTree needed to find the associated type.
* @param parent to which the copy is added.
* @param filter run on all instances before copying.
* @return copy of this instance.
*/
virtual HepRepInstance * copy(HepRepTypeTree * typeTree, HepRepInstanceTree * parent, HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCE_H */
@@ -1,92 +1,92 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPINSTANCETREE_H
#define HEPREP_HEPREPINSTANCETREE_H 1
// Copyright 2000-2004, FreeHEP.
#include <vector>
#include "HEPREP/HepRepTreeID.h"
namespace HEPREP {
class HepRepInstance;
class HepRepSelectFilter;
class HepRepTreeID;
class HepRepTypeTree;
/**
* HepRepInstanceTree interface.
*
* @author Mark Donszelmann
*/
class HepRepInstanceTree : virtual public HepRepTreeID {
public:
/// Destructor.
virtual ~HepRepInstanceTree() { /* nop */; }
/**
* Overlays the instance tree on the current tree.
*
* The list of instances of the instanceTree has to be the same as the current tree.
*/
virtual void overlay(HepRepInstanceTree * instanceTree) = 0;
/**
* Adds an instance to this instancetree.
*
* @param instance to be added.
*/
virtual void addInstance(HepRepInstance * instance) = 0;
/**
* Removes an instance from this instancetree.
*
* @param instance to be removed.
*/
virtual void removeInstance(HepRepInstance * instance) = 0;
/**
* Returns a collection of instances.
*
* @return collection of HepRepInstances.
*/
virtual std::vector<HepRepInstance *> getInstances() = 0;
/**
* Adds a related instance tree to this instancetree.
*
* @param instanceTree related instancetree.
*/
virtual void addInstanceTree(HepRepTreeID * instanceTree) = 0;
/**
* Returns a collection of associated instance trees.
*
* @return collection of HepRepTreeIDs.
*/
virtual std::vector<HepRepTreeID *> getInstanceTreeList() = 0;
/**
* Returns the associated typetree.
*
* @return TreeID of the associated typetree.
*/
virtual HepRepTreeID * getTypeTree() = 0;
/**
* Returns a deep copy of this instancetree.
*
* @param filter to filter the instances.
* @return copy of this instancetree.
*/
virtual HepRepInstanceTree * copy(HepRepTypeTree * typeTree, HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCETREE_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPINSTANCETREE_H
#define HEPREP_HEPREPINSTANCETREE_H 1
// Copyright 2000-2005, FreeHEP.
#include <vector>
#include "HEPREP/HepRepTreeID.h"
namespace HEPREP {
class HepRepInstance;
class HepRepSelectFilter;
class HepRepTreeID;
class HepRepTypeTree;
/**
* HepRepInstanceTree interface.
*
* @author Mark Donszelmann
*/
class HepRepInstanceTree : virtual public HepRepTreeID {
public:
/// Destructor.
virtual ~HepRepInstanceTree() { /* nop */; }
/**
* Overlays the instance tree on the current tree.
*
* The list of instances of the instanceTree has to be the same as the current tree.
*/
virtual void overlay(HepRepInstanceTree * instanceTree) = 0;
/**
* Adds an instance to this instancetree.
*
* @param instance to be added.
*/
virtual void addInstance(HepRepInstance * instance) = 0;
/**
* Removes an instance from this instancetree.
*
* @param instance to be removed.
*/
virtual void removeInstance(HepRepInstance * instance) = 0;
/**
* Returns a collection of instances.
*
* @return collection of HepRepInstances.
*/
virtual std::vector<HepRepInstance *> getInstances() = 0;
/**
* Adds a related instance tree to this instancetree.
*
* @param instanceTree related instancetree.
*/
virtual void addInstanceTree(HepRepTreeID * instanceTree) = 0;
/**
* Returns a collection of associated instance trees.
*
* @return collection of HepRepTreeIDs.
*/
virtual std::vector<HepRepTreeID *> getInstanceTreeList() = 0;
/**
* Returns the associated typetree.
*
* @return TreeID of the associated typetree.
*/
virtual HepRepTreeID * getTypeTree() = 0;
/**
* Returns a deep copy of this instancetree.
*
* @param filter to filter the instances.
* @return copy of this instancetree.
*/
virtual HepRepInstanceTree * copy(HepRepTypeTree * typeTree, HepRepSelectFilter * filter = NULL) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPINSTANCETREE_H */
@@ -1,87 +1,87 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPITERATOR_H
#define HEPREP_HEPREPITERATOR_H 1
// Copyright 2000-2004, FreeHEP.
#include <string>
namespace HEPREP {
class HepRepAttributeListener;
class HepRepFrameListener;
class HepRepInstance;
/**
* HepRepIterator interface.
*
* @author Mark Donszelmann
*/
class HepRepIterator {
public:
/// Destructor.
virtual ~HepRepIterator() { /* nop */; }
/**
* Signals if there is a next instance to iterate to.
*
* @return true if next() can be called.
*/
virtual bool hasNext() = 0;
/**
* Returns next instance.
*
* @return next HepRepInstance.
*/
virtual HepRepInstance * nextInstance() = 0;
/**
* Adds a listener to be informed about attribute changes while iterating.
*
* @param listener to be added.
*/
virtual void addHepRepAttributeListener(std::string name, HepRepAttributeListener * listener) = 0;
/**
* Removes a listener.
*
* @param listener to be removed.
*/
virtual void removeHepRepAttributeListener(std::string name, HepRepAttributeListener * listener) = 0;
/**
* Adds a listener to be informed about attribute changes while iterating.
*
* @param listener to be added.
*/
virtual void addHepRepFrameListener(HepRepFrameListener * listener) = 0;
/**
* Removes a listener.
*
* @param listener to be removed.
*/
virtual void removeHepRepFrameListener(HepRepFrameListener * listener) = 0;
/**
* Returns true if the current instance, just delivered by nextInstance(), is to be drawn as a frame.
*/
virtual bool drawAsFrame() = 0;
/**
* Returns the attValue for key at the current point of iteration.
*
* @param key name of the attribute to be looked up.
* @return value associated to name at this point in the iteration.
*/
// HepRepAttValue* getAttValue(String key);
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPITERATOR_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPITERATOR_H
#define HEPREP_HEPREPITERATOR_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
namespace HEPREP {
class HepRepAttributeListener;
class HepRepFrameListener;
class HepRepInstance;
/**
* HepRepIterator interface.
*
* @author Mark Donszelmann
*/
class HepRepIterator {
public:
/// Destructor.
virtual ~HepRepIterator() { /* nop */; }
/**
* Signals if there is a next instance to iterate to.
*
* @return true if next() can be called.
*/
virtual bool hasNext() = 0;
/**
* Returns next instance.
*
* @return next HepRepInstance.
*/
virtual HepRepInstance * nextInstance() = 0;
/**
* Adds a listener to be informed about attribute changes while iterating.
*
* @param listener to be added.
*/
virtual void addHepRepAttributeListener(std::string name, HepRepAttributeListener * listener) = 0;
/**
* Removes a listener.
*
* @param listener to be removed.
*/
virtual void removeHepRepAttributeListener(std::string name, HepRepAttributeListener * listener) = 0;
/**
* Adds a listener to be informed about attribute changes while iterating.
*
* @param listener to be added.
*/
virtual void addHepRepFrameListener(HepRepFrameListener * listener) = 0;
/**
* Removes a listener.
*
* @param listener to be removed.
*/
virtual void removeHepRepFrameListener(HepRepFrameListener * listener) = 0;
/**
* Returns true if the current instance, just delivered by nextInstance(), is to be drawn as a frame.
*/
virtual bool drawAsFrame() = 0;
/**
* Returns the attValue for key at the current point of iteration.
*
* @param key name of the attribute to be looked up.
* @return value associated to name at this point in the iteration.
*/
// HepRepAttValue* getAttValue(String key);
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPITERATOR_H */
@@ -1,168 +1,168 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPPOINT_H
#define HEPREP_HEPREPPOINT_H 1
// Copyright 2000-2002, FreeHEP.
#include <vector>
#include "HEPREP/HepRepAttribute.h"
namespace HEPREP {
class HepRepInstance;
/**
* HepRepPoint interface. The HepRepMath class can be used to deal with the conversions.
*
* @author Mark Donszelmann
*/
class HepRepPoint : virtual public HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepPoint() { /* nop */; }
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return dx-coordinate
*/
virtual double getX() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return dy-coordinate
*/
virtual double getY() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return dz-coordinate
*/
virtual double getZ() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return rho = std::sqrt(dx2+dy2);
*/
virtual double getRho() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return phi = std::atan2(dy, dx);
*/
virtual double getPhi() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return theta = std::atan2(rho, dx);
*/
virtual double getTheta() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return r = std::sqrt(dx2+dy2+dz2);
*/
virtual double getR() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));
*/
virtual double getEta() = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return dx-coordinate
*/
virtual double getX(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return dy-coordinate
*/
virtual double getY(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return dz-coordinate
*/
virtual double getZ(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return rho = std::sqrt(dx2+dy2);
*/
virtual double getRho(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return phi = std::atan2(dy, dx);
*/
virtual double getPhi(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return theta = std::atan2(rho, dx);
*/
virtual double getTheta(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return r = std::sqrt(dx2+dy2+dz2);
*/
virtual double getR(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));
*/
virtual double getEta(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @param xyz list of three coordinates which are filled and returned.
* If null, a new list of three coordinates is allocated.
* @return list of 3 coordinates.
*/
virtual std::vector<double> * getXYZ(std::vector<double> * xyz) = 0;
/**
* Returns associated instance (parent).
*
* @return HepRepInstance.
*/
virtual HepRepInstance * getInstance() = 0;
/**
* Returns a deep copy of this point.
*
* @param parent to add the copy to.
* @return copy of this point.
*/
virtual HepRepPoint * copy(HepRepInstance * parent) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPPOINT_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPPOINT_H
#define HEPREP_HEPREPPOINT_H 1
// Copyright 2000-2005, FreeHEP.
#include <vector>
#include "HEPREP/HepRepAttribute.h"
namespace HEPREP {
class HepRepInstance;
/**
* HepRepPoint interface. The HepRepMath class can be used to deal with the conversions.
*
* @author Mark Donszelmann
*/
class HepRepPoint : virtual public HepRepAttribute {
public:
/// Destructor.
virtual ~HepRepPoint() { /* nop */; }
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return dx-coordinate
*/
virtual double getX() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return dy-coordinate
*/
virtual double getY() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return dz-coordinate
*/
virtual double getZ() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return rho = sqrt(dx2+dy2);
*/
virtual double getRho() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return phi = atan2(dy, dx);
*/
virtual double getPhi() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return theta = atan2(rho, dx);
*/
virtual double getTheta() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return r = sqrt(dx2+dy2+dz2);
*/
virtual double getR() = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @return eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));
*/
virtual double getEta() = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return dx-coordinate
*/
virtual double getX(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return dy-coordinate
*/
virtual double getY(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return dz-coordinate
*/
virtual double getZ(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return rho = sqrt(dx2+dy2);
*/
virtual double getRho(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return phi = atan2(dy, dx);
*/
virtual double getPhi(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return theta = atan2(rho, dx);
*/
virtual double getTheta(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return r = sqrt(dx2+dy2+dz2);
*/
virtual double getR(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (xVertex, yVertex, zVertex).
*
* @return eta = -0.5*clog((1.-ct)/(1.+ct)), where ct = .cos(getTheta(dx, dy, dz));
*/
virtual double getEta(double xVertex, double yVertex, double zVertex) = 0;
/**
* Returns coordinate with respect to vertex at (0, 0, 0).
*
* @param xyz list of three coordinates which are filled and returned.
* If null, a new list of three coordinates is allocated.
* @return list of 3 coordinates.
*/
virtual std::vector<double> * getXYZ(std::vector<double> * xyz) = 0;
/**
* Returns associated instance (parent).
*
* @return HepRepInstance.
*/
virtual HepRepInstance * getInstance() = 0;
/**
* Returns a deep copy of this point.
*
* @param parent to add the copy to.
* @return copy of this point.
*/
virtual HepRepPoint * copy(HepRepInstance * parent) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPPOINT_H */
@@ -1,124 +1,124 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPREADER_H
#define HEPREP_HEPREPREADER_H 1
// Copyright 2002-2003, Freehep.
#include <string>
#include <vector>
namespace HEPREP {
class HepRep;
/**
* HepRepReader interface.
*
* @author Mark Donszelmann
*/
class HepRepReader {
public:
/// Destructor.
virtual ~HepRepReader() { /* nop */; }
/**
* Returns a property (if set in the heprep.properties file).
*
* @param key property name
* @param defaultValue value if property not found
*/
virtual std::string getProperty(std::string key, std::string defaultValue) = 0;
/**
* Closes the reader and its underlying stream.
*
* @return false in case of a stream problem.
*/
virtual bool close() = 0;
/**
* Allows random access.
*
* @return true if this reader provides random access
*/
virtual bool hasRandomAccess() = 0;
/**
* Reads a HepRep by name (random access only).
*
* @param name for the heprep to be read.
* @return heprep.
*/
virtual HepRep * read(std::string name) = 0;
/**
* Returns the current entry name (random acces only).
*
* @return name of the current entry or null if not supported.
*/
virtual std::string entryName() = 0;
/**
* Returns a list of names of available entries (random rccess only).
* Zip files may contain instructions to skip a number of files. These files
* will not be included in the entries.
*
* @return list of entrynames or null if not supported.
*/
virtual std::vector<std::string> entryNames() = 0;
/**
* Allows for sequential access.
*
* @return true if sequential access is possible.
*/
virtual bool hasSequentialAccess() = 0;
/**
* Resets a sequential HepRep reader.
*
* @return false in case of a stream problem.
*/
virtual bool reset() = 0;
/**
* Returns the (estimated) number of HepReps in the reader.
* Zip files may contain instructions to skip a number of files. These files
* will not be included in the estimate.
*
* @return number of HepReps, or -1 if cannot be calculated.
*/
virtual int size() = 0;
/**
* Skips a number of HepReps in the reader.
* Zip files may contain instructions to skip a number of files. These files
* will not be included in the count to be skipped.
*
* @param n number of HepReps to be skipped.
* @return number of HepReps skipped.
*/
virtual int skip(int n) = 0;
/**
* Is there a next heprep.
*
* @return true if the next heprep is available.
*/
virtual bool hasNext() = 0;
/**
* Reads the next HepRep from the Reader.
*
* @return heprep.
*/
virtual HepRep * next() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPREADER_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPREADER_H
#define HEPREP_HEPREPREADER_H 1
// Copyright 2002-2004, Freehep.
#include <string>
#include <vector>
namespace HEPREP {
class HepRep;
/**
* HepRepReader interface.
*
* @author Mark Donszelmann
*/
class HepRepReader {
public:
/// Destructor.
virtual ~HepRepReader() { /* nop */; }
/**
* Returns a property (if set in the heprep.properties file).
*
* @param key property name
* @param defaultValue value if property not found
*/
virtual std::string getProperty(std::string key, std::string defaultValue) = 0;
/**
* Closes the reader and its underlying stream.
*
* @return false in case of a stream problem.
*/
virtual bool close() = 0;
/**
* Allows random access.
*
* @return true if this reader provides random access
*/
virtual bool hasRandomAccess() = 0;
/**
* Reads a HepRep by name (random access only).
*
* @param name for the heprep to be read.
* @return heprep.
*/
virtual HepRep * read(std::string name) = 0;
/**
* Returns the current entry name (random acces only).
*
* @return name of the current entry or null if not supported.
*/
virtual std::string entryName() = 0;
/**
* Returns a list of names of available entries (random rccess only).
* Zip files may contain instructions to skip a number of files. These files
* will not be included in the entries.
*
* @return list of entrynames or null if not supported.
*/
virtual std::vector<std::string> entryNames() = 0;
/**
* Allows for sequential access.
*
* @return true if sequential access is possible.
*/
virtual bool hasSequentialAccess() = 0;
/**
* Resets a sequential HepRep reader.
*
* @return false in case of a stream problem.
*/
virtual bool reset() = 0;
/**
* Returns the (estimated) number of HepReps in the reader.
* Zip files may contain instructions to skip a number of files. These files
* will not be included in the estimate.
*
* @return number of HepReps, or -1 if cannot be calculated.
*/
virtual int size() = 0;
/**
* Skips a number of HepReps in the reader.
* Zip files may contain instructions to skip a number of files. These files
* will not be included in the count to be skipped.
*
* @param n number of HepReps to be skipped.
* @return number of HepReps skipped.
*/
virtual int skip(int n) = 0;
/**
* Is there a next heprep.
*
* @return true if the next heprep is available.
*/
virtual bool hasNext() = 0;
/**
* Reads the next HepRep from the Reader.
*
* @return heprep.
*/
virtual HepRep * next() = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPREADER_H */
@@ -1,36 +1,36 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPSELECTFILTER_H
#define HEPREP_HEPREPSELECTFILTER_H 1
// Copyright 2000-2002, FreeHEP.
namespace HEPREP {
class HepRepInstance;
/**
* HepRepSelectFilter interface used in copying HepReps.
*
* @author Mark Donszelmann
*/
class HepRepSelectFilter {
public:
/// Destructor.
virtual ~HepRepSelectFilter() { /* nop */; }
/**
* Selects if the given instance will pass.
*
* @param instance to be checked.
* @return true if instance passes.
*/
virtual bool select(HepRepInstance * instance) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPSELECTFILTER_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPSELECTFILTER_H
#define HEPREP_HEPREPSELECTFILTER_H 1
// Copyright 2000-2005, FreeHEP.
namespace HEPREP {
class HepRepInstance;
/**
* HepRepSelectFilter interface used in copying HepReps.
*
* @author Mark Donszelmann
*/
class HepRepSelectFilter {
public:
/// Destructor.
virtual ~HepRepSelectFilter() { /* nop */; }
/**
* Selects if the given instance will pass.
*
* @param instance to be checked.
* @return true if instance passes.
*/
virtual bool select(HepRepInstance * instance) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPSELECTFILTER_H */
@@ -1,64 +1,64 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPTREEID_H
#define HEPREP_HEPREPTREEID_H 1
// Copyright 2000-2003, FreeHEP.
#include <string>
namespace HEPREP {
/**
* HepRepTreeID interface.
*
* @author Mark Donszelmann
*/
class HepRepTreeID {
public:
/// Destructor.
virtual ~HepRepTreeID() { /* nop */; }
/**
* Returns the name of this treeID.
*
* @return name of treeID.
*/
virtual std::string getName() = 0;
/**
* Returns the version of this treeID.
*
* @return version of treeID.
*/
virtual std::string getVersion() = 0;
/**
* Returns the qualifier that qualifies the relation that this treeID has with what it refers to.
*
* @return qualifier.
*/
virtual std::string getQualifier() = 0;
/**
* Sets the qualifier that qualifies the relation that this treeID has with what it refers to.
*
* @param qualifier to be set.
*/
virtual void setQualifier(std::string qualifier) = 0;
/**
* Returns a deep copy of this treeID.
*
* @return copy of this treeID.
* @throws CloneNotSupportedException if copying is not possible.
*/
// HepRepTreeID* copy() throws CloneNotSupportedException;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTREEID_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPTREEID_H
#define HEPREP_HEPREPTREEID_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
namespace HEPREP {
/**
* HepRepTreeID interface.
*
* @author Mark Donszelmann
*/
class HepRepTreeID {
public:
/// Destructor.
virtual ~HepRepTreeID() { /* nop */; }
/**
* Returns the name of this treeID.
*
* @return name of treeID.
*/
virtual std::string getName() = 0;
/**
* Returns the version of this treeID.
*
* @return version of treeID.
*/
virtual std::string getVersion() = 0;
/**
* Returns the qualifier that qualifies the relation that this treeID has with what it refers to.
*
* @return qualifier.
*/
virtual std::string getQualifier() = 0;
/**
* Sets the qualifier that qualifies the relation that this treeID has with what it refers to.
*
* @param qualifier to be set.
*/
virtual void setQualifier(std::string qualifier) = 0;
/**
* Returns a deep copy of this treeID.
*
* @return copy of this treeID.
* @throws CloneNotSupportedException if copying is not possible.
*/
// HepRepTreeID* copy() throws CloneNotSupportedException;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTREEID_H */
@@ -1,109 +1,109 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPTYPE_H
#define HEPREP_HEPREPTYPE_H 1
// Copyright 2000-2003, FreeHEP.
#include <string>
#include <vector>
#include "HEPREP/HepRepDefinition.h"
namespace HEPREP {
/**
* HepRepType interface.
*
* @author Mark Donszelmann
*/
class HepRepType : virtual public HepRepDefinition {
public:
/// Destructor.
virtual ~HepRepType() { /* nop */; }
/**
* Adds a sub-type to this type.
*
* @param type sub-type to be added.
*/
virtual void addType(HepRepType * type) = 0;
/**
* Returns the name of this type.
* This is the full name if one uses flat-types, and the node name if one
* uses hierarchical typenames. It is the name supplied at construction of the type.
*
* @return name of type.
* @see #getFullName()
*/
virtual std::string getName() = 0;
/**
* Returns the full name of this type.
* The full name is constructed from the root of the typeTree (without the typeTreeName)
* by concatenating all the node names separated by slashes "/". For example:
* Geometry/InnerDetector/Sector24/Wire20
*
* @return full name of type.
* @see #getName()
*/
virtual std::string getFullName() = 0;
/**
* Returns the description of this type.
*
* @return description of type.
*/
virtual std::string getDescription() = 0;
/**
* Sets the description of this type.
*
* @param infoURL
*/
virtual void setDescription(std::string description) = 0;
/**
* Returns the information URL of this type.
*
* @return info URL of type.
*/
virtual std::string getInfoURL() = 0;
/**
* Sets the information URL of this type.
*
* @param infoURL
*/
virtual void setInfoURL(std::string infoURL) = 0;
/**
* Returns the parent of this type.
*
* @return parent of type, or null if top-level.
*/
virtual HepRepType * getSuperType() = 0;
/**
* Returns a collection of all the sub-types of this type.
*
* @return collection of HepRepTypes.
*/
virtual std::vector<HepRepType *> getTypeList() = 0;
/**
* Returns a deep copy of this type.
*
* @param parent to which this copy is added.
* @return copy of this type.
*/
virtual HepRepType * copy(HepRepType * parent) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPE_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPTYPE_H
#define HEPREP_HEPREPTYPE_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
#include <vector>
#include "HEPREP/HepRepDefinition.h"
namespace HEPREP {
/**
* HepRepType interface.
*
* @author Mark Donszelmann
*/
class HepRepType : virtual public HepRepDefinition {
public:
/// Destructor.
virtual ~HepRepType() { /* nop */; }
/**
* Adds a sub-type to this type.
*
* @param type sub-type to be added.
*/
virtual void addType(HepRepType * type) = 0;
/**
* Returns the name of this type.
* This is the full name if one uses flat-types, and the node name if one
* uses hierarchical typenames. It is the name supplied at construction of the type.
*
* @return name of type.
* @see #getFullName()
*/
virtual std::string getName() = 0;
/**
* Returns the full name of this type.
* The full name is constructed from the root of the typeTree (without the typeTreeName)
* by concatenating all the node names separated by slashes "/". For example:
* Geometry/InnerDetector/Sector24/Wire20
*
* @return full name of type.
* @see #getName()
*/
virtual std::string getFullName() = 0;
/**
* Returns the description of this type.
*
* @return description of type.
*/
virtual std::string getDescription() = 0;
/**
* Sets the description of this type.
*
* @param infoURL
*/
virtual void setDescription(std::string description) = 0;
/**
* Returns the information URL of this type.
*
* @return info URL of type.
*/
virtual std::string getInfoURL() = 0;
/**
* Sets the information URL of this type.
*
* @param infoURL
*/
virtual void setInfoURL(std::string infoURL) = 0;
/**
* Returns the parent of this type.
*
* @return parent of type, or null if top-level.
*/
virtual HepRepType * getSuperType() = 0;
/**
* Returns a collection of all the sub-types of this type.
*
* @return collection of HepRepTypes.
*/
virtual std::vector<HepRepType *> getTypeList() = 0;
/**
* Returns a deep copy of this type.
*
* @param parent to which this copy is added.
* @return copy of this type.
*/
virtual HepRepType * copy(HepRepType * parent) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPE_H */
@@ -1,66 +1,66 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPTYPETREE_H
#define HEPREP_HEPREPTYPETREE_H 1
// Copyright 2000-2002, FreeHEP.
#include <string>
#include <vector>
#include "HEPREP/HepRepTreeID.h"
namespace HEPREP {
class HepRepType;
/**
* HepRepTypeTree interface.
*
* @author Mark Donszelmann
*/
class HepRepTypeTree : virtual public HepRepTreeID {
public:
/// Destructor.
virtual ~HepRepTypeTree() { /* nop */; }
/**
* Adds a type to this typetree.
*
* @param type to be added.
*/
virtual void addType(HepRepType * type) = 0;
/**
* Returns a collection of all types in this tree.
*
* @return collection of HepRepTypes.
*/
virtual std::vector<HepRepType *> getTypeList() = 0;
/**
* Returns type
*/
virtual HepRepType * getType(std::string fullName) = 0;
/**
* Returns a deep copy of this typetree.
*
* @return copy of this typetree.
*/
virtual HepRepTypeTree * copy() = 0;
//
// To be enable in g++ 3.0
// using HepRep::HepRepTreeID::copy;
// To be disabled in g++ 3.0
// HepRepTreeID * copy();
//
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPETREE_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPTYPETREE_H
#define HEPREP_HEPREPTYPETREE_H 1
// Copyright 2000-2005, FreeHEP.
#include <string>
#include <vector>
#include "HEPREP/HepRepTreeID.h"
namespace HEPREP {
class HepRepType;
/**
* HepRepTypeTree interface.
*
* @author Mark Donszelmann
*/
class HepRepTypeTree : virtual public HepRepTreeID {
public:
/// Destructor.
virtual ~HepRepTypeTree() { /* nop */; }
/**
* Adds a type to this typetree.
*
* @param type to be added.
*/
virtual void addType(HepRepType * type) = 0;
/**
* Returns a collection of all types in this tree.
*
* @return collection of HepRepTypes.
*/
virtual std::vector<HepRepType *> getTypeList() = 0;
/**
* Returns type
*/
virtual HepRepType * getType(std::string fullName) = 0;
/**
* Returns a deep copy of this typetree.
*
* @return copy of this typetree.
*/
virtual HepRepTypeTree * copy() = 0;
//
// To be enable in g++ 3.0
// using HepRep::HepRepTreeID::copy;
// To be disabled in g++ 3.0
// HepRepTreeID * copy();
//
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPTYPETREE_H */
@@ -1,34 +1,34 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPVIEWER_H
#define HEPREP_HEPREPVIEWER_H 1
// Copyright 2000-2003, FreeHEP.
namespace HEPREP {
class HepRep;
/**
* The HepRepViewer interface.
*
* @author Mark Donszelmann
*/
class HepRepViewer {
public:
/// Destructor.
virtual ~HepRepViewer() { /* nop */; }
/**
* Display a heprep
*
*/
virtual void display(HepRep heprep) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPVIEWER_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPVIEWER_H
#define HEPREP_HEPREPVIEWER_H 1
// Copyright 2000-2005, FreeHEP.
namespace HEPREP {
class HepRep;
/**
* The HepRepViewer interface.
*
* @author Mark Donszelmann
*/
class HepRepViewer {
public:
/// Destructor.
virtual ~HepRepViewer() { /* nop */; }
/**
* Display a heprep
*
*/
virtual void display(HepRep heprep) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPVIEWER_H */
@@ -1,163 +1,163 @@
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPWRITER_H
#define HEPREP_HEPREPWRITER_H 1
// Copyright 2002, Freehep.
#include <string>
#include <vector>
namespace HEPREP {
class HepRep;
class HepRepAction;
class HepRepAttDef;
class HepRepAttValue;
class HepRepAttribute;
class HepRepDefinition;
class HepRepInstance;
class HepRepInstanceTree;
class HepRepPoint;
class HepRepTreeID;
class HepRepType;
class HepRepTypeTree;
/**
* HepRepWriter interface.
*
* @author Mark Donszelmann
*/
class HepRepWriter {
public:
/// Destructor.
virtual ~HepRepWriter() { /* nop */; }
/**
* Adds a property, to be written to the HepRep file when closed.
*
* @param key
* @param value
* @return false in case of a stream problem.
*/
virtual bool addProperty(std::string key, std::string value) = 0;
/**
* Closes the writer and its underlying stream.
*
* @return false in case of a stream problem.
*/
virtual bool close() = 0;
/**
* Writes a HepRep.
*
* @param heprep to be written.
* @param name for the heprep to be written (for tagged access), may be ommited.
* @return false in case of a stream problem.
*/
virtual bool write(HepRep * heprep, std::string name) = 0;
/**
* Writes the layerOrder.
*
* @param layerOrder to be written.
* @return false in case of a stream problem.
*/
virtual bool write(std::vector<std::string> layerOrder) = 0;
/**
* Writes a HepRepTypeTree.
*
* @param typeTree to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepTypeTree * typeTree) = 0;
/**
* Writes a HepRepType.
*
* @param type to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepType * type) = 0;
/**
* Writes a HepRepTreeID.
*
* @param treeID to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepTreeID * treeID) = 0;
/**
* Writes a HepRepAction.
*
* @param action to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAction * action) = 0;
/**
* Writes a HepRepInstanceTree.
*
* @param instanceTree to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepInstanceTree * instanceTree) = 0;
/**
* Writes a HepRepInstance.
*
* @param instance to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepInstance * instance) = 0;
/**
* Writes a HepRepPoint.
*
* @param point to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepPoint * point) = 0;
/**
* Writes a HepRepAttribute.
*
* @param attribute to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAttribute * attribute) = 0;
/**
* Writes a HepRepDefinition.
*
* @param definition to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepDefinition * definition) = 0;
/**
* Writes a HepRepAttValue.
*
* @param attValue to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAttValue * attValue) = 0;
/**
* Writes a HepRepAttDef.
*
* @param attDef to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAttDef * attDef) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPWRITER_H */
// -*- C++ -*-
// AID-GENERATED
// =========================================================================
// This class was generated by AID - Abstract Interface Definition
// DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it.
// =========================================================================
#ifndef HEPREP_HEPREPWRITER_H
#define HEPREP_HEPREPWRITER_H 1
// Copyright 2002-2005, Freehep.
#include <string>
#include <vector>
namespace HEPREP {
class HepRep;
class HepRepAction;
class HepRepAttDef;
class HepRepAttValue;
class HepRepAttribute;
class HepRepDefinition;
class HepRepInstance;
class HepRepInstanceTree;
class HepRepPoint;
class HepRepTreeID;
class HepRepType;
class HepRepTypeTree;
/**
* HepRepWriter interface.
*
* @author Mark Donszelmann
*/
class HepRepWriter {
public:
/// Destructor.
virtual ~HepRepWriter() { /* nop */; }
/**
* Adds a property, to be written to the HepRep file when closed.
*
* @param key
* @param value
* @return false in case of a stream problem.
*/
virtual bool addProperty(std::string key, std::string value) = 0;
/**
* Closes the writer and its underlying stream.
*
* @return false in case of a stream problem.
*/
virtual bool close() = 0;
/**
* Writes a HepRep.
*
* @param heprep to be written.
* @param name for the heprep to be written (for tagged access), may be ommited.
* @return false in case of a stream problem.
*/
virtual bool write(HepRep * heprep, std::string name) = 0;
/**
* Writes the layerOrder.
*
* @param layerOrder to be written.
* @return false in case of a stream problem.
*/
virtual bool write(std::vector<std::string> layerOrder) = 0;
/**
* Writes a HepRepTypeTree.
*
* @param typeTree to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepTypeTree * typeTree) = 0;
/**
* Writes a HepRepType.
*
* @param type to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepType * type) = 0;
/**
* Writes a HepRepTreeID.
*
* @param treeID to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepTreeID * treeID) = 0;
/**
* Writes a HepRepAction.
*
* @param action to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAction * action) = 0;
/**
* Writes a HepRepInstanceTree.
*
* @param instanceTree to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepInstanceTree * instanceTree) = 0;
/**
* Writes a HepRepInstance.
*
* @param instance to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepInstance * instance) = 0;
/**
* Writes a HepRepPoint.
*
* @param point to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepPoint * point) = 0;
/**
* Writes a HepRepAttribute.
*
* @param attribute to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAttribute * attribute) = 0;
/**
* Writes a HepRepDefinition.
*
* @param definition to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepDefinition * definition) = 0;
/**
* Writes a HepRepAttValue.
*
* @param attValue to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAttValue * attValue) = 0;
/**
* Writes a HepRepAttDef.
*
* @param attDef to be written.
* @return false in case of a stream problem.
*/
virtual bool write(HepRepAttDef * attDef) = 0;
}; // class
} // namespace HEPREP
#endif /* ifndef HEPREP_HEPREPWRITER_H */
+36
View File
@@ -0,0 +1,36 @@
#ifndef HEPREP_TYPES_H
#define HEPREP_TYPES_H 1
namespace HEPREP {
#if defined(WIN32) && !defined(GNU_GCC)
// WIN32 and NOT GNU_GCC
typedef long int32;
typedef __int64 int64;
#define HEPREP_INT32_FORMAT "%d"
#define HEPREP_INT64_FORMAT "%ld"
#else // other than WIN32-MSVC
#if defined(_LP64)
// 64 Bit Platforms
typedef int int32;
typedef long int64;
#define HEPREP_INT32_FORMAT "%d"
#define HEPREP_INT64_FORMAT "%ld"
#else
// 32-Bit Platforms
typedef long int32;
typedef long long int64;
#define HEPREP_INT32_FORMAT "%ld"
#define HEPREP_INT64_FORMAT "%lld"
#endif // 32-Bit Platforms
#endif // other than WIN32-MSVC
} // namespace HEPREP
#endif
@@ -0,0 +1 @@
source = freehep-heprep-2.0.1
+2 -6
View File
@@ -3,7 +3,7 @@ Apart from the heprep1 files:
G4HepRepFile.hh
G4HepRepFileSceneHandler.hh
G4HepRepFileViewer.hh
ref/HepRepXMLWriter.hh
G4HepRepFileXMLWriter.hh
and heprep2 files:
@@ -12,10 +12,6 @@ G4HepRepSceneHandler.hh
G4HepRepMessenger.hh
G4HepRepViewer.hh
and the zlib headers
zlib/*.h
the other sources are copies from the FreeHEP library
(java.freehep.org) and are maintained there.
@@ -23,5 +19,5 @@ The files starting with G4 are geant4 compliant, the others may not be.
Changes made here may be overwritten.
11 December 2003
4 May 2005
Mark Donszelmann
@@ -0,0 +1,48 @@
// Copyright FreeHEP, 2005.
#ifndef ABSTRACTXMLWRITER_H
#define ABSTRACTXMLWRITER_H 1
#include "cheprep/config.h"
#include <string>
/**
* @author Mark Donszelmann
* @version $Id: AbstractXMLWriter.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class AbstractXMLWriter {
public:
AbstractXMLWriter(std::string defaultNameSpace) : defaultNameSpace(defaultNameSpace) {
}
virtual ~AbstractXMLWriter() {
}
virtual void openTag(std::string ns, std::string name) = 0;
virtual void printTag(std::string ns, std::string name) = 0;
virtual void setAttribute(std::string ns, std::string name, std::string value) = 0;
virtual void setAttribute(std::string ns, std::string name, double value) = 0;
virtual void close() = 0;
virtual void openDoc(std::string version = "1.0", std::string encoding = "", bool standalone = false) = 0;
virtual void closeDoc(bool force = false) = 0;
virtual void openTag(std::string name) = 0;
virtual void closeTag() = 0;
virtual void printTag(std::string name) = 0;
virtual void setAttribute(std::string name, char* value) = 0;
virtual void setAttribute(std::string name, std::string value) = 0;
virtual void setAttribute(std::string name, std::vector<double> value) = 0;
virtual void setAttribute(std::string name, int64 value) = 0;
virtual void setAttribute(std::string name, int value) = 0;
virtual void setAttribute(std::string name, bool value) = 0;
virtual void setAttribute(std::string name, double value) = 0;
protected:
std::string defaultNameSpace;
};
} // cheprep
#endif // ABSTRACTXMLWRITER_H
+131
View File
@@ -0,0 +1,131 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_BHEPREPWRITER_H
#define CHEPREP_BHEPREPWRITER_H
#include "cheprep/config.h"
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include "cheprep/AbstractXMLWriter.h"
/**
* @author Mark Donszelmann
* @version $Id: BHepRepWriter.h,v 1.9 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class BHepRepWriter : public AbstractXMLWriter {
public:
BHepRepWriter(std::ostream& os);
virtual ~BHepRepWriter();
void close();
void openDoc(std::string version = "BinaryHepRep/1.0", std::string encoding = "UTF-8", bool standalone = false);
void closeDoc(bool force = false);
void openTag(std::string name);
void closeTag();
void printTag(std::string name);
void setAttribute(std::string name, char* value);
void setAttribute(std::string name, std::string value);
void setAttribute(std::string name, std::vector<double> value);
void setAttribute(std::string name, int64 value);
void setAttribute(std::string name, int value);
void setAttribute(std::string name, bool value);
void setAttribute(std::string name, double value);
//
// Can be removed when we can properly inherit those (since names are equal to overloaded ones).
//
void openTag(std::string ns, std::string name) {
openTag(ns == defaultNameSpace ? name : ns.append(":").append(name));
}
void printTag(std::string ns, std::string name) {
printTag(ns == defaultNameSpace ? name : ns.append(":").append(name));
}
void setAttribute(std::string ns, std::string name, std::string value) {
setAttribute(ns.append(":").append(name), value);
}
void setAttribute(std::string ns, std::string name, double value) {
setAttribute(ns.append(":").append(name), value);
}
private:
static const unsigned char WBXML_VERSION = 0x03;
static const unsigned char UNKNOWN_PID = 0x01;
static const unsigned char UTF8 = 0x6a;
// standard tags
static const unsigned char SWITCH_PAGE = 0x00;
static const unsigned char END = 0x01;
static const unsigned char ENTITY = 0x02;
static const unsigned char STR_I = 0x03;
static const unsigned char LITERAL = 0x04;
static const unsigned char CONTENT = 0x40;
static const unsigned char EXT_I_0 = 0x40;
static const unsigned char EXT_I_1 = 0x41;
static const unsigned char EXT_I_2 = 0x42;
static const unsigned char PI = 0x43;
static const unsigned char LITERAL_C = 0x44;
static const unsigned char ATTRIBUTE = 0x80;
static const unsigned char EXT_T_0 = 0x80;
static const unsigned char EXT_T_1 = 0x81;
static const unsigned char EXT_T_2 = 0x82;
static const unsigned char STR_T = 0x83;
static const unsigned char LITERAL_A = 0x84;
static const unsigned char EXT_0 = 0xC0;
static const unsigned char EXT_1 = 0xC1;
static const unsigned char EXT_2 = 0xC2;
static const unsigned char OPAQUE = 0xC3;
static const unsigned char LITERAL_AC = 0xC4;
// our own extensions
static const unsigned char STR_D = EXT_I_0;
static const unsigned char STR_R = EXT_T_0;
// class definitions
static std::map<std::string, unsigned char> tags;
static std::map<std::string, unsigned char> attributes;
static std::map<std::string, unsigned char> values;
// outputstream variables
std::ostream& os;
bool singlePrecision;
bool isBigEndian;
// document variables
std::map<std::string, unsigned int> stringValues;
// tag variables
std::map<std::string, std::string> stringAttributes;
std::map<std::string, std::vector<double> > colorAttributes;
std::map<std::string, int64> longAttributes;
std::map<std::string, int> intAttributes;
std::map<std::string, bool> booleanAttributes;
std::map<std::string, double> doubleAttributes;
// point array
std::vector<double> points;
// methods
void writeTag(std::string name, bool content = false);
void writePoints();
void writeStringDefine(std::string s);
void writeMultiByteInt(unsigned int ui);
void writeReal(double ui);
void writeLong(int64 i);
void writeInt(int i);
void writeByte(unsigned char b);
void writeString(std::string s);
};
} // cheprep
#endif // CHEPREP_BHEPREPWRITER_H
@@ -1,58 +1,63 @@
#ifndef DEFAULTHEPREP_H
#define DEFAULTHEPREP_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepInstanceTree.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRep : public virtual HEPREP::HepRep {
private:
std::vector<std::string> layers;
std::vector<HEPREP::HepRepTypeTree*> typeTrees;
std::vector<HEPREP::HepRepInstanceTree*> instanceTrees;
public:
DefaultHepRep();
~DefaultHepRep();
HEPREP::HepRep* copy(HEPREP::HepRepSelectFilter* filter);
std::vector<std::string> getLayerOrder();
void addLayer(std::string layer);
void addTypeTree(HEPREP::HepRepTypeTree* typeTree);
void removeTypeTree(HEPREP::HepRepTypeTree* typeTree);
HEPREP::HepRepTypeTree* getTypeTree(std::string name, std::string version);
std::vector<HEPREP::HepRepTypeTree*> getTypeTreeList();
void addInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
void overlayInstanceTree(HEPREP::HepRepInstanceTree * instanceTree);
void removeInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
HEPREP::HepRepInstanceTree* getInstanceTreeTop(std::string name, std::string version);
HEPREP::HepRepInstanceTree* getInstances(std::string name, std::string version,
std::vector<std::string> typeNames);
HEPREP::HepRepInstanceTree* getInstancesAfterAction(
std::string name,
std::string version,
std::vector<std::string> typeNames,
std::vector<HEPREP::HepRepAction*> actions,
bool getPoints,
bool getDrawAtts,
bool getNonDrawAtts,
std::vector<std::string> invertAtts);
std::string checkForException();
std::vector<HEPREP::HepRepInstanceTree*> getInstanceTreeList();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREP_H
#define CHEPREP_DEFAULTHEPREP_H 1
#include "cheprep/config.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepInstanceTree.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRep.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRep : public virtual HEPREP::HepRep {
private:
std::vector<std::string> layers;
std::vector<HEPREP::HepRepTypeTree*> typeTrees;
std::vector<HEPREP::HepRepInstanceTree*> instanceTrees;
public:
DefaultHepRep();
~DefaultHepRep();
HEPREP::HepRep* copy(HEPREP::HepRepSelectFilter* filter);
std::vector<std::string> getLayerOrder();
void addLayer(std::string layer);
void addTypeTree(HEPREP::HepRepTypeTree* typeTree);
void removeTypeTree(HEPREP::HepRepTypeTree* typeTree);
HEPREP::HepRepTypeTree* getTypeTree(std::string name, std::string version);
std::vector<HEPREP::HepRepTypeTree*> getTypeTreeList();
void addInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
void overlayInstanceTree(HEPREP::HepRepInstanceTree * instanceTree);
void removeInstanceTree(HEPREP::HepRepInstanceTree* instanceTree);
HEPREP::HepRepInstanceTree* getInstanceTreeTop(std::string name, std::string version);
HEPREP::HepRepInstanceTree* getInstances(std::string name, std::string version,
std::vector<std::string> typeNames);
HEPREP::HepRepInstanceTree* getInstancesAfterAction(
std::string name,
std::string version,
std::vector<std::string> typeNames,
std::vector<HEPREP::HepRepAction*> actions,
bool getPoints,
bool getDrawAtts,
bool getNonDrawAtts,
std::vector<std::string> invertAtts);
std::string checkForException();
std::vector<HEPREP::HepRepInstanceTree*> getInstanceTreeList();
};
} // cheprep
#endif
@@ -1,29 +1,35 @@
#ifndef DEFAULTHEPREPACTION_H
#define DEFAULTHEPREPACTION_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepAction.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAction : public virtual HEPREP::HepRepAction {
private:
std::string name;
std::string expression;
public:
DefaultHepRepAction(std::string name, std::string expression);
~DefaultHepRepAction();
std::string getName();
std::string getExpression();
HEPREP::HepRepAction* copy();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPACTION_H
#define CHEPREP_DEFAULTHEPREPACTION_H 1
#include "cheprep/config.h"
#include <string>
#include "HEPREP/HepRepAction.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepAction.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepAction : public virtual HEPREP::HepRepAction {
private:
std::string name;
std::string expression;
public:
DefaultHepRepAction(std::string name, std::string expression);
~DefaultHepRepAction();
std::string getName();
std::string getExpression();
HEPREP::HepRepAction* copy();
};
} // cheprep
#endif
@@ -1,32 +1,37 @@
#ifndef DEFAULTHEPREPATTDEF_H
#define DEFAULTHEPREPATTDEF_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepAttDef.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAttDef : public virtual HEPREP::HepRepAttDef {
private:
std::string name, desc, category, extra;
public:
DefaultHepRepAttDef(std::string name, std::string desc, std::string category, std::string extra);
~DefaultHepRepAttDef();
HEPREP::HepRepAttDef* copy();
std::string getName();
std::string getLowerCaseName();
std::string getDescription();
std::string getCategory();
std::string getExtra();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPATTDEF_H
#define CHEPREP_DEFAULTHEPREPATTDEF_H 1
#include "cheprep/config.h"
#include <string>
#include "HEPREP/HepRepAttDef.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepAttDef.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepAttDef : public virtual HEPREP::HepRepAttDef {
private:
std::string name, desc, category, extra;
public:
DefaultHepRepAttDef(std::string name, std::string desc, std::string category, std::string extra);
~DefaultHepRepAttDef();
HEPREP::HepRepAttDef* copy();
std::string getName();
std::string getLowerCaseName();
std::string getDescription();
std::string getCategory();
std::string getExtra();
};
} // cheprep
#endif
@@ -1,64 +1,76 @@
#ifndef DEFAULTHEPREPATTVALUE_H
#define DEFAULTHEPREPATTVALUE_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepAttValue.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAttValue : public virtual HEPREP::HepRepAttValue {
private:
enum { LABELSTRINGS_LEN = 4 };
std::string name;
int type;
// values implemented as separate items, so that they do not take up unnecessary space for an Object
// only ONE of these is filled
std::string stringValue;
long longValue;
double doubleValue;
bool booleanValue;
std::vector<double> colorValue;
int showLabelValue;
std::string labelStrings[LABELSTRINGS_LEN];
void init();
public:
DefaultHepRepAttValue(std::string name, std::string value, int showLabel);
DefaultHepRepAttValue(std::string name, long value, int showLabel);
DefaultHepRepAttValue(std::string name, int value, int showLabel);
DefaultHepRepAttValue(std::string name, double value, int showLabel);
DefaultHepRepAttValue(std::string name, bool value, int showLabel);
DefaultHepRepAttValue(std::string name, std::vector<double> value, int showLabel);
~DefaultHepRepAttValue();
HEPREP::HepRepAttValue* copy();
std::string getName();
std::string getLowerCaseName();
int getType();
std::string getTypeName();
int showLabel();
std::string getString();
std::string getLowerCaseString();
long getLong();
int getInteger();
double getDouble();
bool getBoolean();
std::vector<double> getColor();
std::string getAsString();
std::string toShowLabel();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPATTVALUE_H
#define CHEPREP_DEFAULTHEPREPATTVALUE_H 1
#include "cheprep/config.h"
#include <string>
#include "HEPREP/HepRepAttValue.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepAttValue.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepAttValue : public virtual HEPREP::HepRepAttValue {
private:
enum { LABELSTRINGS_LEN = 4 };
std::string name;
int type;
// values implemented as separate items, so that they do not take up unnecessary space for an Object
// only ONE of these is filled
std::string stringValue;
int64 longValue;
double doubleValue;
bool booleanValue;
std::vector<double> colorValue;
int showLabelValue;
static std::string labelStrings[LABELSTRINGS_LEN];
void init();
public:
DefaultHepRepAttValue(std::string name, std::string value, int showLabel);
DefaultHepRepAttValue(std::string name, int64 value, int showLabel);
DefaultHepRepAttValue(std::string name, int value, int showLabel);
DefaultHepRepAttValue(std::string name, double value, int showLabel);
DefaultHepRepAttValue(std::string name, bool value, int showLabel);
DefaultHepRepAttValue(std::string name, std::vector<double> value, int showLabel);
~DefaultHepRepAttValue();
HEPREP::HepRepAttValue* copy();
std::string getName();
std::string getLowerCaseName();
int getType();
std::string getTypeName();
int showLabel();
std::string getString();
std::string getLowerCaseString();
int64 getLong();
int getInteger();
double getDouble();
bool getBoolean();
std::vector<double> getColor();
std::string getAsString();
static std::string getAsString(std::vector<double> c);
static std::string getAsString(int i);
static std::string getAsString(int64 i);
static std::string getAsString(double d);
static std::string getAsString(bool b);
std::string toShowLabel();
static std::string toShowLabel(int showLabel);
};
} // cheprep
#endif
@@ -1,44 +1,51 @@
#ifndef DEFAULTHEPREPATTRIBUTE_H
#define DEFAULTHEPREPATTRIBUTE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <map>
#include <set>
#include <vector>
#include "HEPREP/HepRepAttribute.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepConstants.h"
#include "HEPREP/HepRepWriter.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepAttribute : public virtual HEPREP::HepRepAttribute {
private:
std::map<std::string, HEPREP::HepRepAttValue*> attValues;
public:
DefaultHepRepAttribute();
~DefaultHepRepAttribute();
std::set<HEPREP::HepRepAttValue*> getAttValuesFromNode();
void addAttValue(HEPREP::HepRepAttValue* hepRepAttValue);
void addAttValue(std::string key, char *value, int showLabel);
void addAttValue(std::string key, std::string value, int showLabel);
void addAttValue(std::string key, int value, int showLabel);
void addAttValue(std::string key, double value, int showLabel);
void addAttValue(std::string key, bool value, int showLabel);
void addAttValue(std::string key, std::vector<double> value, int showLabel);
void addAttValue(std::string key, double red, double green, double blue, double alpha, int showLabel);
HEPREP::HepRepAttValue* getAttValueFromNode(std::string lowerCaseName);
HEPREP::HepRepAttValue* removeAttValue(std::string key);
HEPREP::HepRepAttValue* getAttValue(std::string name) = 0;
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPATTRIBUTE_H
#define CHEPREP_DEFAULTHEPREPATTRIBUTE_H 1
#include "cheprep/config.h"
#include <string>
#include <map>
#include <set>
#include <vector>
#include "HEPREP/HepRepAttribute.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepConstants.h"
#include "HEPREP/HepRepWriter.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepAttribute.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepAttribute : public virtual HEPREP::HepRepAttribute {
private:
std::map<std::string, HEPREP::HepRepAttValue*> attValues;
public:
DefaultHepRepAttribute();
~DefaultHepRepAttribute();
std::set<HEPREP::HepRepAttValue*> getAttValuesFromNode();
void addAttValue(HEPREP::HepRepAttValue* hepRepAttValue);
void addAttValue(std::string key, char *value, int showLabel);
void addAttValue(std::string key, std::string value, int showLabel);
void addAttValue(std::string key, int value, int showLabel);
void addAttValue(std::string key, int64 value, int showLabel);
void addAttValue(std::string key, double value, int showLabel);
void addAttValue(std::string key, bool value, int showLabel);
void addAttValue(std::string key, std::vector<double> value, int showLabel);
void addAttValue(std::string key, double red, double green, double blue, double alpha, int showLabel);
HEPREP::HepRepAttValue* getAttValueFromNode(std::string lowerCaseName);
HEPREP::HepRepAttValue* removeAttValue(std::string key);
HEPREP::HepRepAttValue* getAttValue(std::string name) = 0;
};
} // cheprep
#endif
@@ -1,37 +1,43 @@
#ifndef DEFAULTHEPREPDEFINITION_H
#define DEFAULTHEPREPDEFINITION_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepDefinition : public DefaultHepRepAttribute, public virtual HEPREP::HepRepDefinition {
private:
std::map<std::string, HEPREP::HepRepAttDef*> attDefs;
public:
DefaultHepRepDefinition();
~DefaultHepRepDefinition();
void addAttDef(HEPREP::HepRepAttDef* hepRepAttDef);
void addAttDef(std::string name, std::string desc, std::string type, std::string extra);
std::set<HEPREP::HepRepAttDef *> getAttDefsFromNode();
HEPREP::HepRepAttDef* getAttDefFromNode(std::string lowerCaseName);
HEPREP::HepRepAttDef* getAttDef(std::string name) = 0;
HEPREP::HepRepAttValue* getAttValue(std::string name) = 0;
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPDEFINITION_H
#define CHEPREP_DEFAULTHEPREPDEFINITION_H 1
#include "cheprep/config.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRepDefinition.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepAttribute.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepDefinition.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepDefinition : public DefaultHepRepAttribute, public virtual HEPREP::HepRepDefinition {
private:
std::map<std::string, HEPREP::HepRepAttDef*> attDefs;
public:
DefaultHepRepDefinition();
~DefaultHepRepDefinition();
void addAttDef(HEPREP::HepRepAttDef* hepRepAttDef);
void addAttDef(std::string name, std::string desc, std::string type, std::string extra);
std::set<HEPREP::HepRepAttDef *> getAttDefsFromNode();
HEPREP::HepRepAttDef* getAttDefFromNode(std::string lowerCaseName);
HEPREP::HepRepAttDef* getAttDef(std::string name) = 0;
HEPREP::HepRepAttValue* getAttValue(std::string name) = 0;
};
} // cheprep
#endif
@@ -1,49 +1,55 @@
#ifndef DEFAULTHEPREPFACTORY_H
#define DEFAULTHEPREPFACTORY_H 1
#include "FreeHepTypes.h"
#include <string>
#include <iostream>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepReader.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepFactory : public virtual HEPREP::HepRepFactory {
public:
DefaultHepRepFactory();
~DefaultHepRepFactory();
// static HEPREP::HepRepFactory* create();
HEPREP::HepRepReader* createHepRepReader (std::istream* in);
HEPREP::HepRepReader* createHepRepReader (std::string filename);
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out, bool randomAccess, bool compress);
HEPREP::HepRepPoint* createHepRepPoint (HEPREP::HepRepInstance* instance,
double x, double y, double z);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
HEPREP::HepRepTreeID* createHepRepTreeID (std::string name, std::string version, std::string qualifier = "top-level");
HEPREP::HepRepAction* createHepRepAction (std::string name, std::string expression);
HEPREP::HepRepInstanceTree* createHepRepInstanceTree (std::string name, std::string version,
HEPREP::HepRepTreeID* typeTreeID);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepType* parent, std::string name);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepTypeTree* parent, std::string name);
HEPREP::HepRepTypeTree* createHepRepTypeTree (HEPREP::HepRepTreeID* treeID);
HEPREP::HepRep* createHepRep ();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPFACTORY_H
#define CHEPREP_DEFAULTHEPREPFACTORY_H 1
#include "cheprep/config.h"
#include <string>
#include <iostream>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepReader.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepFactory.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepFactory : public virtual HEPREP::HepRepFactory {
public:
DefaultHepRepFactory();
~DefaultHepRepFactory();
// static HEPREP::HepRepFactory* create();
HEPREP::HepRepReader* createHepRepReader (std::istream* in);
HEPREP::HepRepReader* createHepRepReader (std::string filename);
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out, bool randomAccess, bool compress);
HEPREP::HepRepPoint* createHepRepPoint (HEPREP::HepRepInstance* instance,
double x, double y, double z);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
HEPREP::HepRepInstance* createHepRepInstance (HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
HEPREP::HepRepTreeID* createHepRepTreeID (std::string name, std::string version, std::string qualifier = "top-level");
HEPREP::HepRepAction* createHepRepAction (std::string name, std::string expression);
HEPREP::HepRepInstanceTree* createHepRepInstanceTree (std::string name, std::string version,
HEPREP::HepRepTreeID* typeTreeID);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepType* parent, std::string name);
HEPREP::HepRepType* createHepRepType (HEPREP::HepRepTypeTree* parent, std::string name);
HEPREP::HepRepTypeTree* createHepRepTypeTree (HEPREP::HepRepTreeID* treeID);
HEPREP::HepRep* createHepRep ();
};
} // cheprep
#endif
@@ -1,53 +1,59 @@
#ifndef DEFAULTHEPREPINSTANCE_H
#define DEFAULTHEPREPINSTANCE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepAttValue.h"
#include "DefaultHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepInstance : public DefaultHepRepAttribute, public virtual HEPREP::HepRepInstance {
private:
HEPREP::HepRepInstance* parent;
HEPREP::HepRepType* type;
std::vector<HEPREP::HepRepPoint*> points;
std::vector<HEPREP::HepRepInstance*> instances;
public:
DefaultHepRepInstance(HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
DefaultHepRepInstance(HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
~DefaultHepRepInstance();
void overlay(HEPREP::HepRepInstance * instance);
HEPREP::HepRepInstance* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepInstance* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepInstance* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepType* getType();
void addPoint(HEPREP::HepRepPoint* point);
std::vector<HEPREP::HepRepPoint *> getPoints();
HEPREP::HepRepInstance* getSuperInstance();
void addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance *> getInstances();
HEPREP::HepRepAttValue* getAttValue(std::string name);
void *getParent() { return parent; }
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPINSTANCE_H
#define CHEPREP_DEFAULTHEPREPINSTANCE_H 1
#include "cheprep/config.h"
#include <string>
#include <vector>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepAttValue.h"
#include "DefaultHepRepAttribute.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepInstance.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepInstance : public DefaultHepRepAttribute, public virtual HEPREP::HepRepInstance {
private:
HEPREP::HepRepInstance* parent;
HEPREP::HepRepType* type;
std::vector<HEPREP::HepRepPoint*> points;
std::vector<HEPREP::HepRepInstance*> instances;
public:
DefaultHepRepInstance(HEPREP::HepRepInstance* parent, HEPREP::HepRepType* type);
DefaultHepRepInstance(HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepType* type);
~DefaultHepRepInstance();
void overlay(HEPREP::HepRepInstance * instance);
HEPREP::HepRepInstance* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepInstance* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepInstance* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepInstanceTree* parent, HEPREP::HepRepSelectFilter* filter);
HEPREP::HepRepType* getType();
void addPoint(HEPREP::HepRepPoint* point);
std::vector<HEPREP::HepRepPoint *> getPoints();
HEPREP::HepRepInstance* getSuperInstance();
void addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance *> getInstances();
HEPREP::HepRepAttValue* getAttValue(std::string name);
void *getParent() { return parent; }
};
} // cheprep
#endif
@@ -1,44 +1,50 @@
#ifndef DEFAULTHEPREPINSTANCETREE_H
#define DEFAULTHEPREPINSTANCETREE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepInstanceTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepInstanceTree {
private:
HEPREP::HepRepTreeID* typeTree;
std::vector<HEPREP::HepRepInstance*> instances;
std::vector<HEPREP::HepRepTreeID*> instanceTrees;
public:
DefaultHepRepInstanceTree(std::string name, std::string version, HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepInstanceTree();
void overlay(HEPREP::HepRepInstanceTree * instanceTree);
HEPREP::HepRepInstanceTree* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepSelectFilter* filter);
void addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance*> getInstances();
void addInstanceTree(HEPREP::HepRepTreeID* treeID);
HEPREP::HepRepTreeID* getTypeTree();
std::vector<HEPREP::HepRepTreeID*> getInstanceTreeList();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPINSTANCETREE_H
#define CHEPREP_DEFAULTHEPREPINSTANCETREE_H 1
#include "cheprep/config.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepSelectFilter.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepInstanceTree.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepInstanceTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepInstanceTree {
private:
HEPREP::HepRepTreeID* typeTree;
std::vector<HEPREP::HepRepInstance*> instances;
std::vector<HEPREP::HepRepTreeID*> instanceTrees;
public:
DefaultHepRepInstanceTree(std::string name, std::string version, HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepInstanceTree();
void overlay(HEPREP::HepRepInstanceTree * instanceTree);
HEPREP::HepRepInstanceTree* copy(HEPREP::HepRepTypeTree* typeTree, HEPREP::HepRepSelectFilter* filter);
void addInstance(HEPREP::HepRepInstance* instance);
void removeInstance(HEPREP::HepRepInstance* instance);
std::vector<HEPREP::HepRepInstance*> getInstances();
void addInstanceTree(HEPREP::HepRepTreeID* treeID);
HEPREP::HepRepTreeID* getTypeTree();
std::vector<HEPREP::HepRepTreeID*> getInstanceTreeList();
};
} // cheprep
#endif
@@ -1,56 +1,62 @@
#ifndef DEFAULTHEPREPPOINT_H
#define DEFAULTHEPREPPOINT_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepPoint.h"
#include "DefaultHepRepAttribute.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepPoint : public DefaultHepRepAttribute, public virtual HEPREP::HepRepPoint {
private:
HEPREP::HepRepInstance* instance;
protected:
double x, y, z;
public:
DefaultHepRepPoint(HEPREP::HepRepInstance* instance, double x, double y, double z);
~DefaultHepRepPoint();
HEPREP::HepRepInstance* getInstance();
HEPREP::HepRepAttValue* getAttValue(std::string lowerCaseName);
HEPREP::HepRepPoint* copy(HEPREP::HepRepInstance* parent);
double getX();
double getY();
double getZ();
std::vector<double>* getXYZ(std::vector<double>* xyz);
double getRho();
double getPhi();
double getTheta();
double getR();
double getEta();
double getX(double xVertex, double yVertex, double zVertex);
double getY(double xVertex, double yVertex, double zVertex);
double getZ(double xVertex, double yVertex, double zVertex);
double getRho(double xVertex, double yVertex, double zVertex);
double getPhi(double xVertex, double yVertex, double zVertex);
double getTheta(double xVertex, double yVertex, double zVertex);
double getR(double xVertex, double yVertex, double zVertex);
double getEta(double xVertex, double yVertex, double zVertex);
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPPOINT_H
#define CHEPREP_DEFAULTHEPREPPOINT_H 1
#include "cheprep/config.h"
#include <string>
#include <vector>
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepPoint.h"
#include "DefaultHepRepAttribute.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepPoint.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepPoint : public DefaultHepRepAttribute, public virtual HEPREP::HepRepPoint {
private:
HEPREP::HepRepInstance* instance;
protected:
double x, y, z;
public:
DefaultHepRepPoint(HEPREP::HepRepInstance* instance, double x, double y, double z);
~DefaultHepRepPoint();
HEPREP::HepRepInstance* getInstance();
HEPREP::HepRepAttValue* getAttValue(std::string lowerCaseName);
HEPREP::HepRepPoint* copy(HEPREP::HepRepInstance* parent);
double getX();
double getY();
double getZ();
std::vector<double>* getXYZ(std::vector<double>* xyz);
double getRho();
double getPhi();
double getTheta();
double getR();
double getEta();
double getX(double xVertex, double yVertex, double zVertex);
double getY(double xVertex, double yVertex, double zVertex);
double getZ(double xVertex, double yVertex, double zVertex);
double getRho(double xVertex, double yVertex, double zVertex);
double getPhi(double xVertex, double yVertex, double zVertex);
double getTheta(double xVertex, double yVertex, double zVertex);
double getR(double xVertex, double yVertex, double zVertex);
double getEta(double xVertex, double yVertex, double zVertex);
};
} // cheprep
#endif
@@ -1,32 +1,37 @@
#ifndef DEFAULTHEPREPTREEID_H
#define DEFAULTHEPREPTREEID_H 1
#include "FreeHepTypes.h"
#include <string>
#include "HEPREP/HepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepTreeID : public virtual HEPREP::HepRepTreeID {
private:
std::string name;
std::string version;
std::string qualifier;
public:
DefaultHepRepTreeID(std::string name, std::string version, std::string qualifier = "top_level");
~DefaultHepRepTreeID();
std::string getQualifier();
void setQualifier(std::string qualifier);
std::string getName();
std::string getVersion();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPTREEID_H
#define CHEPREP_DEFAULTHEPREPTREEID_H 1
#include "cheprep/config.h"
#include <string>
#include "HEPREP/HepRepTreeID.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepTreeID.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepTreeID : public virtual HEPREP::HepRepTreeID {
private:
std::string name;
std::string version;
std::string qualifier;
public:
DefaultHepRepTreeID(std::string name, std::string version, std::string qualifier = "top_level");
~DefaultHepRepTreeID();
std::string getQualifier();
void setQualifier(std::string qualifier);
std::string getName();
std::string getVersion();
};
} // cheprep
#endif
@@ -1,50 +1,56 @@
#ifndef DEFAULTHEPREPTYPE_H
#define DEFAULTHEPREPTYPE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepDefinition.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepType : public DefaultHepRepDefinition, public virtual HEPREP::HepRepType {
private:
HEPREP::HepRepType* parent;
std::vector<HEPREP::HepRepType*> types;
std::string name;
std::string description;
std::string infoURL;
public:
DefaultHepRepType(HEPREP::HepRepType* parent, std::string name);
DefaultHepRepType(HEPREP::HepRepTypeTree* parent, std::string name);
~DefaultHepRepType();
HEPREP::HepRepType* getSuperType();
HEPREP::HepRepAttDef* getAttDef(std::string name);
HEPREP::HepRepAttValue* getAttValue(std::string name);
HEPREP::HepRepType* copy(HEPREP::HepRepType* parent);
std::string getName();
std::string getFullName();
std::string getDescription();
void setDescription(std::string description);
std::string getInfoURL();
void setInfoURL(std::string infoURL);
void addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType*> getTypeList();
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPTYPE_H
#define CHEPREP_DEFAULTHEPREPTYPE_H 1
#include "cheprep/config.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepDefinition.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepType.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepType : public DefaultHepRepDefinition, public virtual HEPREP::HepRepType {
private:
HEPREP::HepRepType* parent;
std::vector<HEPREP::HepRepType*> types;
std::string name;
std::string description;
std::string infoURL;
public:
DefaultHepRepType(HEPREP::HepRepType* parent, std::string name);
DefaultHepRepType(HEPREP::HepRepTypeTree* parent, std::string name);
~DefaultHepRepType();
HEPREP::HepRepType* getSuperType();
HEPREP::HepRepAttDef* getAttDef(std::string name);
HEPREP::HepRepAttValue* getAttValue(std::string name);
HEPREP::HepRepType* copy(HEPREP::HepRepType* parent);
std::string getName();
std::string getFullName();
std::string getDescription();
void setDescription(std::string description);
std::string getInfoURL();
void setInfoURL(std::string infoURL);
void addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType*> getTypeList();
};
} // cheprep
#endif
@@ -1,37 +1,43 @@
#ifndef DEFAULTHEPREPTYPETREE_H
#define DEFAULTHEPREPTYPETREE_H 1
#include "FreeHepTypes.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
*
* @author M.Donszelmann
*/
class DefaultHepRepTypeTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepTypeTree {
private:
std::vector<HEPREP::HepRepType*> types;
public:
DefaultHepRepTypeTree(HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepTypeTree();
HEPREP::HepRepTypeTree* copy();
void addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType* > getTypeList();
HEPREP::HepRepType* getType(std::string name);
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFAULTHEPREPTYPETREE_H
#define CHEPREP_DEFAULTHEPREPTYPETREE_H 1
#include "cheprep/config.h"
#include <string>
#include <vector>
#include <set>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepTreeID.h"
#include "DefaultHepRepTreeID.h"
/**
* @author Mark Donszelmann
* @version $Id: DefaultHepRepTypeTree.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DefaultHepRepTypeTree : public DefaultHepRepTreeID, public virtual HEPREP::HepRepTypeTree {
private:
std::vector<HEPREP::HepRepType*> types;
public:
DefaultHepRepTypeTree(HEPREP::HepRepTreeID* typeTree);
~DefaultHepRepTypeTree();
HEPREP::HepRepTypeTree* copy();
void addType(HEPREP::HepRepType* type);
std::vector<HEPREP::HepRepType* > getTypeList();
HEPREP::HepRepType* getType(std::string name);
};
} // cheprep
#endif
@@ -0,0 +1,98 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
#define CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
#include <vector>
#include <iostream>
#include <string>
#ifndef CHEPREP_NO_ZLIB
#include <zlib.h>
#endif // CHEPREP_NO_ZLIB
/**
* @author Mark Donszelmann
* @version $Id: DeflateOutputStreamBuffer.h,v 1.5 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class DeflateOutputStreamBuffer : public std::streambuf {
public:
DeflateOutputStreamBuffer(std::streambuf *buffer);
void init(bool compress);
void finish();
virtual ~DeflateOutputStreamBuffer();
protected:
int overflow(int c = EOF);
#ifndef CHEPREP_NO_ZLIB
bool flushOut();
#endif // CHEPREP_NO_ZLIB
inline void putUI(unsigned int ui) {
unsigned char* ucp = reinterpret_cast<unsigned char *>(&ui);
unsigned int i = (static_cast<unsigned int>(ucp[ 3 ]) << 24) +
(static_cast<unsigned int>(ucp[ 2 ]) << 16) +
(static_cast<unsigned int>(ucp[ 1 ]) << 8 ) +
(static_cast<unsigned int>(ucp[ 0 ]));
buffer->sputn(reinterpret_cast<char *>(&i), sizeof(unsigned int));
}
inline void putUS(unsigned short us) {
unsigned char* ucp = reinterpret_cast<unsigned char *>(&us);
unsigned short s = (static_cast<unsigned short>(ucp[ 1 ]) << 8 ) +
(static_cast<unsigned short>(ucp[ 0 ]));
buffer->sputn(reinterpret_cast<char *>(&s), sizeof(unsigned short));
}
inline void putUB(unsigned char ub) {
buffer->sputc(ub);
}
inline void putS(const std::string s) {
buffer->sputn(s.c_str(), s.length());
}
inline std::streampos pos() {
std::ostream os(buffer);
return os.tellp();
}
inline unsigned int getSize() {
return size;
}
inline unsigned int getCRC() {
return crc;
}
private:
static unsigned long crctable[256];
std::streambuf *buffer;
unsigned int crc;
unsigned int size;
#ifndef CHEPREP_NO_ZLIB
static const unsigned int inSize = 1000;
static const unsigned int outSize = 1000;
z_stream zStream;
bool zStreamOpen;
std::vector<char> in;
std::vector<char> out;
#endif // CHEPREP_NO_ZLIB
};
} // cheprep
#endif // CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
@@ -0,0 +1,34 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_GZIPOUTPUTSTREAM_H
#define CHEPREP_GZIPOUTPUTSTREAM_H
#include <string>
#include "cheprep/GZIPOutputStreamBuffer.h"
/**
* @author Mark Donszelmann
* @version $Id: GZIPOutputStream.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class GZIPOutputStream : public std::ostream {
public:
GZIPOutputStream(std::ostream &os);
void setFilename(const std::string &filename);
void setComment(const std::string &comment);
void close();
virtual ~GZIPOutputStream();
private:
GZIPOutputStreamBuffer *buffer;
};
} // cheprep.
#endif // CHEPREP_GZIPOUTPUTSTREAM_H
@@ -0,0 +1,42 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_GZIPOUTPUTSTREAMBUF_H
#define CHEPREP_GZIPOUTPUTSTREAMBUF_H
#include <string>
#include "cheprep/DeflateOutputStreamBuffer.h"
/**
* @author Mark Donszelmann
* @version $Id: GZIPOutputStreamBuffer.h,v 1.4 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class GZIPOutputStreamBuffer : public DeflateOutputStreamBuffer {
public:
GZIPOutputStreamBuffer( std::streambuf *outbuf );
int overflow(int);
void setFilename( const std::string &filename );
void setComment( const std::string &comment );
void close() ;
virtual ~GZIPOutputStreamBuffer() ;
private:
void writeHeader();
void writeTrailer();
std::string filename;
std::string comment;
bool open;
};
} // cheprep
#endif // CHEPREP_GZIPOUTPUTSTREAMBUF_H
@@ -1,48 +1,55 @@
#ifndef INDENTPRINTWRITER_H
#define INDENTPRINTWRITER_H 1
#include "FreeHepTypes.h"
#include <iostream>
#include <string>
/**
* A PrintWriter that keeps track of an indentation level
* and indents the output appropriately.
*
* <b>Warning:</b> Only print and println methods taking strings have been overriden,
* print, println methods taking other arguments may not be indented properly.
*
* @author Mark Donszelmann
*/
class IndentPrintWriter {
public:
IndentPrintWriter(std::ostream* out, int level = 0);
virtual ~IndentPrintWriter();
void close();
IndentPrintWriter& operator<< (const std::string & s);
IndentPrintWriter& operator<< (std::ostream& (*pf)(std::ostream&));
void println(const std::string & s);
void print(const std::string & s);
void println();
void indent();
void outdent();
int getIndent() const;
void setIndent(const int level);
std::string getIndentString() const;
void setIndentString(const std::string & indentString);
private:
void doIndent();
std::ostream* out;
bool closed;
int indentLevel;
bool indented;
std::string indentString;
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_INDENTPRINTWRITER_H
#define CHEPREP_INDENTPRINTWRITER_H 1
#include "cheprep/config.h"
#include <iostream>
#include <string>
/**
* A PrintWriter that keeps track of an indentation level
* and indents the output appropriately.
*
* <b>Warning:</b> Only print and println methods taking strings have been overriden,
* print, println methods taking other arguments may not be indented properly.
*
* @author Mark Donszelmann
* @version $Id: IndentPrintWriter.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class IndentPrintWriter {
public:
IndentPrintWriter(std::ostream* out, int level = 0);
virtual ~IndentPrintWriter();
void close();
IndentPrintWriter& operator<< (const std::string & s);
IndentPrintWriter& operator<< (std::ostream& (*pf)(std::ostream&));
void println(const std::string & s);
void print(const std::string & s);
void println();
void indent();
void outdent();
int getIndent() const;
void setIndent(const int level);
std::string getIndentString() const;
void setIndentString(const std::string & indentString);
private:
void doIndent();
std::ostream* out;
bool closed;
int indentLevel;
bool indented;
std::string indentString;
};
} // cheprep
#endif
@@ -1,27 +1,33 @@
#ifndef XMLHEPREPFACTORY_H
#define XMLHEPREPFACTORY_H 1
#include <string>
#include <iostream>
#include "HEPREP/HepRepReader.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepFactory.h"
/**
*
* @author M.Donszelmann
*/
class XMLHepRepFactory : public DefaultHepRepFactory {
public:
XMLHepRepFactory();
~XMLHepRepFactory();
HEPREP::HepRepReader* createHepRepReader (std::istream* in);
HEPREP::HepRepReader* createHepRepReader (std::string filename);
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out, bool randomAccess, bool compress);
};
#endif
// Copyright FreeHEP, 2005.
#ifndef XMLHEPREPFACTORY_H
#define XMLHEPREPFACTORY_H 1
#include <string>
#include <iostream>
#include "HEPREP/HepRepReader.h"
#include "HEPREP/HepRepWriter.h"
#include "DefaultHepRepFactory.h"
/**
* @author Mark Donszelmann
* @version $Id: XMLHepRepFactory.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class XMLHepRepFactory : public DefaultHepRepFactory {
public:
XMLHepRepFactory();
~XMLHepRepFactory();
HEPREP::HepRepReader* createHepRepReader (std::istream* in);
HEPREP::HepRepReader* createHepRepReader (std::string filename);
HEPREP::HepRepWriter* createHepRepWriter (std::ostream* out, bool randomAccess, bool compress);
};
} // cheprep
#endif
@@ -1,66 +1,73 @@
#ifndef XMLHEPREPWRITER_H
#define XMLHEPREPWRITER_H 1
#include "FreeHepTypes.h"
#include <iostream>
#include <string>
#include <stack>
#include <set>
#include <vector>
#include <map>
#include "zipios++/zipoutputstream.h"
#include "zipios++/gzipoutputstream.h"
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepAttribute.h"
#include "XMLWriter.h"
/**
*
* @author M.Donszelmann
*/
class XMLHepRepWriter : public virtual HEPREP::HepRepWriter {
private:
std::string nameSpace;
XMLWriter *xml;
zipios::ZipOutputStream *zip;
zipios::GZIPOutputStream *gz;
std::map<std::string, std::string> properties;
public:
XMLHepRepWriter(std::ostream* out, bool randomAccess, bool compress);
~XMLHepRepWriter();
bool addProperty(std::string key, std::string value);
bool close();
bool write(HEPREP::HepRep* heprep, std::string name);
bool write(std::vector<std::string> layers);
bool write(HEPREP::HepRepTypeTree* typeTree);
bool write(HEPREP::HepRepType* type);
bool write(HEPREP::HepRepTreeID* treeID);
bool write(HEPREP::HepRepAction* action);
bool write(HEPREP::HepRepInstanceTree* instanceTree);
bool write(HEPREP::HepRepInstance* instance);
bool write(HEPREP::HepRepPoint* point);
bool write(HEPREP::HepRepAttribute* attribute);
bool write(HEPREP::HepRepDefinition* definition);
bool write(HEPREP::HepRepAttValue* attValue);
bool write(HEPREP::HepRepAttDef* attDef);
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_XMLHEPREPWRITER_H
#define CHEPREP_XMLHEPREPWRITER_H 1
#include "cheprep/config.h"
#include <iostream>
#include <string>
#include <stack>
#include <set>
#include <vector>
#include <map>
#include "HEPREP/HepRep.h"
#include "HEPREP/HepRepFactory.h"
#include "HEPREP/HepRepWriter.h"
#include "HEPREP/HepRepPoint.h"
#include "HEPREP/HepRepInstance.h"
#include "HEPREP/HepRepInstanceTree.h"
#include "HEPREP/HepRepTreeID.h"
#include "HEPREP/HepRepAction.h"
#include "HEPREP/HepRepType.h"
#include "HEPREP/HepRepTypeTree.h"
#include "HEPREP/HepRepAttDef.h"
#include "HEPREP/HepRepAttValue.h"
#include "HEPREP/HepRepAttribute.h"
#include "cheprep/AbstractXMLWriter.h"
#include "cheprep/ZipOutputStream.h"
#include "cheprep/GZIPOutputStream.h"
/**
* @author Mark Donszelmann
* @version $Id: XMLHepRepWriter.h,v 1.4 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class XMLHepRepWriter : public virtual HEPREP::HepRepWriter {
private:
std::ostream *out;
bool compress;
std::string nameSpace;
AbstractXMLWriter *xml;
cheprep::ZipOutputStream *zip;
cheprep::GZIPOutputStream *gz;
std::map<std::string, std::string> properties;
public:
XMLHepRepWriter(std::ostream* out, bool randomAccess, bool compress);
~XMLHepRepWriter();
bool addProperty(std::string key, std::string value);
bool close();
bool write(HEPREP::HepRep* heprep, std::string name);
bool write(std::vector<std::string> layers);
bool write(HEPREP::HepRepTypeTree* typeTree);
bool write(HEPREP::HepRepType* type);
bool write(HEPREP::HepRepTreeID* treeID);
bool write(HEPREP::HepRepAction* action);
bool write(HEPREP::HepRepInstanceTree* instanceTree);
bool write(HEPREP::HepRepInstance* instance);
bool write(HEPREP::HepRepPoint* point);
bool write(HEPREP::HepRepAttribute* attribute);
bool write(HEPREP::HepRepDefinition* definition);
bool write(HEPREP::HepRepAttValue* attValue);
bool write(HEPREP::HepRepAttDef* attDef);
};
} // cheprep
#endif
@@ -1,59 +1,81 @@
#ifndef XMLWRITER_H
#define XMLWRITER_H 1
#include "FreeHepTypes.h"
#include <iostream>
#include <map>
#include <stack>
#include <vector>
#include <string>
#include "IndentPrintWriter.h"
/**
* A class that makes it easy to write XML documents.
*
* @author Tony Johnson
* @author Mark Donszelmann
*/
class XMLWriter {
public:
XMLWriter(std::ostream* out, std::string indentString = " ", std::string defaultNameSpace = "");
virtual ~XMLWriter();
void close();
void openDoc(std::string version = "1.0", std::string encoding = "", bool standalone = false);
void referToDTD(std::string name, std::string pid, std::string ref);
void referToDTD(std::string name, std::string system);
void closeDoc(bool force = false);
void printComment(std::string comment);
void printPlain(std::string text);
void print(std::string text);
void println(std::string text);
void openTag(std::string ns, std::string name);
void openTag(std::string name);
void closeTag();
void printTag(std::string ns, std::string name);
void printTag(std::string name);
void setAttribute(std::string name, std::string value);
void setAttribute(std::string ns, std::string name, std::string value);
void setAttribute(std::string name, double value);
void setAttribute(std::string ns, std::string name, double value);
void printAttributes(int tagLength);
std::string normalize(std::string s);
std::string normalizeText(std::string s);
void checkNameValid(std::string s);
protected:
bool closed;
IndentPrintWriter* writer;
std::string defaultNameSpace;
private:
std::string dtdName;
std::map<std::string, std::string> attributes;
std::stack<std::string> openTags;
};
#endif
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_XMLWRITER_H
#define CHEPREP_XMLWRITER_H 1
#include "cheprep/config.h"
#include <iostream>
#include <map>
#include <stack>
#include <vector>
#include <string>
#include "cheprep/AbstractXMLWriter.h"
#include "cheprep/IndentPrintWriter.h"
/**
* @author Mark Donszelmann
* @version $Id: XMLWriter.h,v 1.3 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class XMLWriter : public AbstractXMLWriter {
public:
XMLWriter(std::ostream* out, std::string indentString = " ", std::string defaultNameSpace = "");
virtual ~XMLWriter();
void close();
void openDoc(std::string version = "1.0", std::string encoding = "", bool standalone = false);
void referToDTD(std::string name, std::string pid, std::string ref);
void referToDTD(std::string name, std::string system);
void closeDoc(bool force = false);
void printComment(std::string comment);
void printPlain(std::string text);
void print(std::string text);
void println(std::string text);
void openTag(std::string name);
void closeTag();
void printTag(std::string name);
void setAttribute(std::string name, char* value);
void setAttribute(std::string name, std::string value);
void setAttribute(std::string name, std::vector<double> value);
void setAttribute(std::string name, int64 value);
void setAttribute(std::string name, int value);
void setAttribute(std::string name, bool value);
void setAttribute(std::string name, double value);
void printAttributes(int tagLength);
std::string normalize(std::string s);
std::string normalizeText(std::string s);
void checkNameValid(std::string s);
//
// Can be removed when we can properly inherit those (since names are equal to overloaded ones).
//
void openTag(std::string ns, std::string name) {
openTag(ns == defaultNameSpace ? name : ns.append(":").append(name));
}
void printTag(std::string ns, std::string name) {
printTag(ns == defaultNameSpace ? name : ns.append(":").append(name));
}
void setAttribute(std::string ns, std::string name, std::string value) {
setAttribute(ns.append(":").append(name), value);
}
void setAttribute(std::string ns, std::string name, double value) {
setAttribute(ns.append(":").append(name), value);
}
protected:
bool closed;
IndentPrintWriter* writer;
private:
std::string dtdName;
std::map<std::string, std::string> attributes;
std::stack<std::string> openTags;
};
} // cheprep
#endif
+37
View File
@@ -0,0 +1,37 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_ZIPENTRY_H
#define CHEPREP_ZIPENTRY_H
#include <string>
#include <vector>
/**
* @author Mark Donszelmann
* @version $Id: ZipEntry.h,v 1.9 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class ZipEntry {
public:
std::string name;
int method;
int date;
int time;
unsigned int crc;
unsigned int size;
unsigned int csize;
long offset;
long data;
ZipEntry() {
}
virtual ~ZipEntry() {
}
};
} // cheprep
#endif // CHEPREP_ZIPENTRY_H
@@ -0,0 +1,40 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_ZIPOUTPUTSTREAM_H
#define CHEPREP_ZIPOUTPUTSTREAM_H
#include <string>
#include <iostream>
#include <vector>
/**
* @author Mark Donszelmann
* @version $Id: ZipOutputStream.h,v 1.9 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class ZipOutputStreamBuffer;
class ZipOutputStream : public std::ostream {
public:
ZipOutputStream(std::ostream& os);
void closeEntry();
void close();
void putNextEntry(const std::string& name, bool compress);
void setComment(const std::string& comment);
virtual ~ZipOutputStream();
private:
ZipOutputStreamBuffer* buffer;
};
} // cheprep
#endif // CHEPREP_ZIPOUTPUTSTREAM_H
@@ -0,0 +1,58 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_ZIPOUTPUTSTREAMBUFFER_H
#define CHEPREP_ZIPOUTPUTSTREAMBUFFER_H
#include <string>
#include <iostream>
#include <vector>
#include "cheprep/DeflateOutputStreamBuffer.h"
/**
* @author Mark Donszelmann
* @version $Id: ZipOutputStreamBuffer.h,v 1.9 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
class ZipEntry;
class ZipOutputStreamBuffer : public DeflateOutputStreamBuffer {
public:
ZipOutputStreamBuffer(std::streambuf* buffer);
int overflow(int c);
void closeEntry();
void close();
void putNextEntry(const std::string& name, bool compress);
void setMethod(int method);
void setComment(const std::string& comment);
virtual ~ZipOutputStreamBuffer();
private:
std::string comment;
bool closed;
ZipEntry* entry;
std::vector<ZipEntry*>* entries;
static const unsigned int LOCSIG = 0x04034b50;
static const unsigned int EXTSIG = 0x08074b50;
static const unsigned int CENSIG = 0x02014b50;
static const unsigned int ENDSIG = 0x06054b50;
static const unsigned int VERSIONMADE = 0x0014;
static const unsigned int VERSIONEXTRACT = 0x0014;
static const unsigned int GENFLAG = 0x0008;
};
} // cheprep
#endif // CHEPREP_ZIPOUTPUTSTREAMBUFFER_H
+63
View File
@@ -0,0 +1,63 @@
// Copyright FreeHEP, 2005.
#ifndef CHEPREP_CONFIG_H
#define CHEPREP_CONFIG_H 1
/**
* @author Mark Donszelmann
* @version $Id: config.h,v 1.4 2005/06/02 21:28:45 duns Exp $
*/
namespace cheprep {
#if defined(WIN32) && !defined(GNU_GCC)
// WIN32 and NOT GNU_GCC
typedef __int64 int64;
typedef unsigned __int64 uint64;
#define CHEPREP_INT64_FORMAT "%ld"
#define CHEPREP_UINT64_FORMAT "%uld"
#else // other than WIN32-MSVC
#if defined(_LP64)
// 64 Bit Platforms
typedef long int64;
typedef unsigned long uint64;
#define CHEPREP_INT64_FORMAT "%ld"
#define CHEPREP_UINT64_FORMAT "%uld"
#else
// 32-Bit Platforms
typedef long long int64;
typedef unsigned long long uint64;
#define CHEPREP_INT64_FORMAT "%lld"
#define CHEPREP_UINT64_FORMAT "%ulld"
#endif // 32-Bit Platforms
#endif // other than WIN32-MSVC
} // namespace cheprep
#ifdef WIN32
#ifndef GNU_GCC
// Disable warning C4786: identifier was truncated to '255' characters in the debug information
#pragma warning ( disable : 4786 )
// Disable warning C4250: inherits via dominance
#pragma warning ( disable : 4250 )
#ifdef VC6
// FIX for KB 168440 - VC6
// Stream Operator << Cannot Handle __int64 Type
#include<iostream>
inline std::ostream& operator<<(std::ostream& os, __int64 i ) {
char buf[20];
sprintf(buf,"%I64d", i );
os << buf;
return os;
}
#endif // VC6
#endif // GNU_GCC
#endif // WIN32
#endif // CHEPREP_CONFIG_H
@@ -0,0 +1 @@
source = freehep-cheprep-2.0.5
@@ -1,26 +0,0 @@
#ifndef FREEHEPTYPES_H
#define FREEHEPTYPES_H
#ifdef WIN32
#ifndef GNU_GCC
// Disable warning C4786: identifier was truncated to '255' characters in the debug information
#pragma warning ( disable : 4786 )
// Disable warning C4250: inherits via dominance
#pragma warning ( disable : 4250 )
#ifdef VC6
// FIX for KB 168440 - VC6
// Stream Operator << Cannot Handle __int64 Type
#include<iostream>
inline std::ostream& operator<<(std::ostream& os, __int64 i ) {
char buf[20];
sprintf(buf,"%I64d", i );
os << buf;
return os;
}
#endif // VC6
#endif // GNU_GCC
#endif // WIN32
#endif // FREEHEPTYPES_H
@@ -1,21 +0,0 @@
Mark Donszelmann - 07/07/2003
=============================
Files renamed from .cpp to .cc
=====================================================
Main author: Thomas Sondergaard (thomass@deltadata.dk)
FreeBSD port maintainer: Ying-Chieh Liao (ijliao@csie.nctu.edu.tw)
The files zipios++/directory.h and zipios++/directory.cpp originate
from the dir_it library written by Dietmar Kuehl (it's available for
download at http://www.boost.org)
zipios++.spec contributed by Rui Miguel Silva Seabra
libtool/shared library patch contributed by Arkadiusz Miskiewicz (arekm)
Russel Winder (r.winder@180sw.com) did the work of amending the code to
so as to work with GCC 3.2.1.
Ross Burton (r.burton@180sw.com) transformed zipios++.spec into
zipios++.spec.in and made it more RedHat tradition conformant.
@@ -1,515 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
^L
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
^L
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
^L
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
^L
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
^L
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
^L
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
^L
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
^L
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
<one line to give the library's name and a brief idea of what it
does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper
mail.
You should also get your employer (if you work as a programmer) or
your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -1,117 +0,0 @@
#ifndef BACKBUFFER_H
#define BACKBUFFER_H
#include "zipios++/zipios-config.h"
#include <algorithm>
#include "zipios++/meta-iostreams.h"
#include <vector>
#include "zipios++/fcollexceptions.h"
#include "zipios++/ziphead.h"
#include "zipios++/zipheadio.h"
#include "zipios++/virtualseeker.h"
#include "zipios_common.h"
namespace zipios {
using std::ios ;
using std::cerr ;
using std::endl ;
/** A BackBuffer instance is useful for reading the last part of a
file in an efficient manner, when it is not known exactly how far
back (towards the front!) to go, to find the start of the desired
data block. BackBuffer is a vector< unsigned char > that fills
itself with data from a file by reading chunks from the end of the
file progressing towards the start. Upon construction the
BackBuffer instance is associated with a file and a chunksize can
be specified. To read a chunk of the file into the BackBuffer call
readChunk(). */
class BackBuffer : public vector< unsigned char > {
public:
/** BackBuffer constructor.
@param is The istream to read the data from. The stream must be seekable,
as BackBuffer will reposition the file position to read chunks from the back
of the file.
@param chunk_size specifies the size of the chunks to read the file into
the BackBuffer in.
@throw FCollException Thrown if the VirtualSeeker vs that has been specified is
invalid for the istream is. */
inline explicit BackBuffer( istream &is, VirtualSeeker vs = VirtualSeeker(),
int chunk_size = 1024 ) ;
/** Reads another chunk and returns the size of the chunk that has
been read. Returns 0 on I/O failure.
@param read_pointer When a new chunk is read in the already
stored bytes change position in the BackBuffer. read_pointer is
assumed by readChunk() to be a pointer into a position in the
BackBuffer, and is updated to point to the same position in the file
as it pointed to before the new chunk was read. */
inline int readChunk( int &read_pointer ) ;
private:
VirtualSeeker _vs ;
int _chunk_size ;
istream &_is ;
streampos _file_pos ;
};
BackBuffer::BackBuffer( istream &is, VirtualSeeker vs, int chunk_size )
: _vs ( vs ),
_chunk_size( chunk_size ),
_is ( is )
{
_vs.vseekg( is, 0, ios::end ) ;
_file_pos = _vs.vtellg( is ) ;
// Only happens if _vs.startOffset() is a position
// in the file that lies after _vs.endOffset(), which
// is clearly not a valid situation.
if ( _file_pos < 0 )
throw FCollException( "Invalid virtual file endings" ) ;
}
int BackBuffer::readChunk( int &read_pointer ) {
// Update chunk_size and file position
_chunk_size = min<int> ( static_cast< int >( _file_pos ), _chunk_size ) ;
_file_pos -= _chunk_size ;
_vs.vseekg( _is, _file_pos, ios::beg ) ;
// Make space for _chunk_size new bytes first in buffer
insert ( begin(), _chunk_size, static_cast< char > ( 0 ) ) ;
// Read in the next _chunk_size of bytes
readByteSeq ( _is, &( (*this)[ 0 ] ), _chunk_size ) ;
read_pointer += _chunk_size ;
if ( _is.good() )
return _chunk_size ;
else
return 0 ;
}
}
#endif
/** \file
The header file for BackBuffer
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,87 +0,0 @@
#ifndef BASICENTRY_H
#define BASICENTRY_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include "zipios++/fcollexceptions.h"
#include "zipios++/fileentry.h"
#include "zipios++/filepath.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
/** BasicEntry is a FileEntry that is suitable as a base class for
basic entries, that e.g. do not support any form of compression */
class BasicEntry : public FileEntry {
public:
/** Constructor.
@param filename the filename of the entry.
@param comment a comment for the entry.
*/
explicit BasicEntry( const string &filename, const string &comment,
const FilePath &basepath = FilePath() ) ;
virtual string getComment() const ;
virtual uint32 getCompressedSize() const ;
virtual uint32 getCrc() const ;
virtual vector< unsigned char > getExtra() const ;
virtual StorageMethod getMethod() const ;
virtual string getName() const ;
virtual string getFileName() const ;
virtual uint32 getSize() const ;
virtual int getTime() const ;
virtual bool isValid() const ;
// virtual int hashCode() const ;
virtual bool isDirectory() const ;
virtual void setComment( const string &comment ) ;
virtual void setCompressedSize( uint32 size ) ;
virtual void setCrc( uint32 crc ) ;
virtual void setExtra( const vector< unsigned char > &extra ) ;
virtual void setMethod( StorageMethod method ) ;
virtual void setName( const string &name ) ;
virtual void setSize( uint32 size ) ;
virtual void setTime( int time ) ;
virtual string toString() const ;
virtual FileEntry *clone() const ;
virtual ~BasicEntry() ;
protected:
string _filename ;
string _comment ;
int _size ;
bool _valid ;
FilePath _basepath ;
};
}
#endif
/** \file
Header file that defines BasicEntry.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,174 +0,0 @@
#ifndef COLLCOLL_H
#define COLLCOLL_H
#include "zipios++/zipios-config.h"
#include <string>
#include <vector>
#include "zipios++/fcoll.h"
namespace zipios {
using std::string ;
/** \anchor collcoll_anchor
CollectionCollection is a FileCollection that consists of an
arbitrary number of FileCollections. With a CollectionCollection
the user can use multiple FileCollections transparently, making it
easy for a program to keep some of its files in a zip archive and
others stored in ordinary files. CollectionCollection can be used
to create a simple virtual filesystem, where all collections are
mounted in /. If more than one collection contain a file with
the same path only the one in the first added collection will
be accessible.
*/
class CollectionCollection : public FileCollection {
public:
/** \anchor collcoll_inst_anchor
This static method provides a singleton instance of a CollectionCollection.
The instance is instantiated the first time the method is called.
@return A pointer to a singleton CollectionCollection instance.
*/
static inline CollectionCollection &inst() ;
/** Constructor.
*/
explicit CollectionCollection() ;
/** Copy constructor. */
inline CollectionCollection( const CollectionCollection &src ) ;
/** Copy assignment operator. */
inline const CollectionCollection &operator= ( const CollectionCollection &src ) ;
/** \anchor collcoll_addcoll_anchor
Adds a collection.
@param collection The collection to add.
@return true if the collection was added succesfully and
the added collection is valid.
*/
bool addCollection( const FileCollection &collection ) ;
/** Adds the collection pointed to by collection. The CollectionCollection
will call delete on the pointer when it is destructed, so the caller
should make absolutely sure to only pass in a collection created with new
and be sure to leave it alone after adding it. If the collection is not
added false is returned and the caller remains responsible for the
collection pointed to by collection.
@param collection A pointer to the collection to add.
@return true if the collection was added succesfully and
the added collection is valid. */
bool addCollection( FileCollection *collection ) ;
virtual void close() ;
virtual ConstEntries entries() const ;
virtual ConstEntryPointer getEntry( const string &name,
MatchPath matchpath = MATCH ) const ;
virtual istream *getInputStream( const ConstEntryPointer &entry ) ;
virtual istream *getInputStream( const string &entry_name,
MatchPath matchpath = MATCH ) ;
/** Returns the number in entries in all collections kept by
the CollectionCollection object */
virtual int size() const ;
virtual FileCollection *clone() const ;
virtual ~CollectionCollection() ;
protected:
/** A protected getEntry member function, that not only
finds an entry that match the name, if such an entry exists
in the collection, it also returns, which collection it was found
in.
*/
void getEntry( const string &name,
ConstEntryPointer &cep,
std::vector< FileCollection * >::const_iterator &it,
MatchPath matchpath = MATCH ) const ;
vector< FileCollection * > _collections ;
private:
static CollectionCollection *_inst ;
};
/** Shortcut name for a CollectionCollection. If the static method
inst is used, it is often used a lot, so it's handy with a short name for
CollectionCollection */
typedef CollectionCollection CColl ;
//
// Inline (member) functions
//
CollectionCollection &CollectionCollection::inst() {
if( _inst != 0 )
return *_inst ;
else
return *( _inst = new CollectionCollection ) ;
}
CollectionCollection::CollectionCollection( const CollectionCollection &src )
: FileCollection( src )
{
_collections.reserve( src._collections.size() ) ;
std::vector< FileCollection * >::const_iterator it ;
for ( it = src._collections.begin() ; it != src._collections.end() ; ++it )
_collections.push_back( (*it)->clone() ) ;
}
const CollectionCollection &
CollectionCollection::operator= ( const CollectionCollection &src ) {
this->FileCollection::operator=( src ) ;
// FileCollection::=( static_cast< FileCollection >( src ) ) ;
if ( this != &src ) {
// Destroy current contents.
std::vector< FileCollection * >::const_iterator it ;
for ( it = _collections.begin() ; it != _collections.end() ; ++it )
delete *it ;
// Then copy src's content.
_collections.clear() ;
_collections.reserve( src._collections.size() ) ;
for ( it = src._collections.begin() ; it != src._collections.end() ; ++it )
_collections.push_back( (*it)->clone() ) ;
}
return *this ;
}
} // namespace
#endif
/** \file
Header file that defines CollectionCollection.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,109 +0,0 @@
#ifndef DEFLATEOUTPUTSTREAMBUF_H
#define DEFLATEOUTPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <vector>
#include <HepRep-zlib.h>
#include "zipios++/filteroutputstreambuf.h"
#include "zipios++/ziphead.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
using std::vector ;
/** DeflateOutputStreambuf is an output stream filter, that deflates
the data that is written to it before it passes it on to the
output stream it is attached to. Deflation/Inflation is a
compression/decompression method used in gzip and zip. The zlib
library is used to perform the actual deflation, this class only
wraps the functionality in an output stream filter. */
class DeflateOutputStreambuf : public FilterOutputStreambuf {
public:
/** DeflateOutputStreambuf constructor.
@param outbuf the streambuf to use for output.
@param user_init If false user must invoke init() before writing any data.
(ZipOutputStreambuf needs to do this)
@param del_outbuf if true is specified outbuf will be deleted, when
the DeflateOutputStreambuf is destructed. */
explicit DeflateOutputStreambuf( streambuf *outbuf, bool user_init = false,
bool del_outbuf = false ) ;
/** Destructor. */
virtual ~DeflateOutputStreambuf() ;
bool init( int comp_level = 6 ) ;
bool closeStream() ;
/** Returns the CRC32 for the current stream. The returned value is
the CRC for the data that has been compressed already (due to a
call to overflow()). As DeflateOutputStreambuf may buffer an
arbitrary amount of bytes until closeStream() has been invoked,
the returned value is not very useful before closeStream() has
been called. */
uint32 getCrc32() const { return _crc32 ; }
/** Returns the number of bytes written to the streambuf, that has
been processed from the input buffer by the compressor. After
closeStream() has been called this number is the total number of
bytes written to the stream. */
uint32 getCount() const { return _overflown_bytes ; }
protected:
virtual int overflow( int c = EOF ) ;
virtual int sync() ;
/** Flushes _outvec and updates _zs.next_out and _zs.avail_out. */
bool flushOutvec() ;
/** Flushes the remaining data in the zlib buffers, after which the
only possible operations are deflateEnd() or deflateReset(). */
void endDeflation() ;
private:
z_stream _zs ;
bool _zs_initialized ;
protected: // FIXME: reconsider design?
const int _invecsize ;
vector< char > _invec ;
const int _outvecsize ;
vector< char > _outvec ;
uint32 _crc32 ;
uint32 _overflown_bytes ;
};
} // namespace
#endif
/** \file
Header file that defines DeflateOutputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,93 +0,0 @@
#ifndef DIRCOLL_H
#define DIRCOLL_H
#include "zipios++/zipios-config.h"
#include "zipios++/fcoll.h"
#include "zipios++/basicentry.h"
#include "zipios++/filepath.h"
namespace zipios {
/** DirEntry is a BasicEntry. */
typedef BasicEntry DirEntry ;
/** \anchor dircol_anchor
DirectoryCollection is a FileCollection that obtains its entries
from a directory. */
class DirectoryCollection : public FileCollection {
public:
/** Default Constructor. */
explicit DirectoryCollection()
: _entries_loaded( false ), _recursive( true ) {}
/** Constructor.
@param path A directory path name. If the name is not a valid
directory the created DirectoryCollection will be invalid.
@param load_now Load directory into memory now. Otherwise it will
be done when it is first needed.
*/
explicit DirectoryCollection( const string &path,
bool recursive = true,
bool load_now = false ) ;
/* Default Copy constructor and copy assignment operator are sufficient. */
virtual void close() ;
virtual ConstEntries entries() const ;
virtual ConstEntryPointer getEntry( const string &name,
MatchPath matchpath = MATCH ) const ;
virtual istream *getInputStream( const ConstEntryPointer &entry ) ;
virtual istream *getInputStream( const string &entry_name,
MatchPath matchpath = MATCH ) ;
virtual int size() const ;
virtual FileCollection *clone() const ;
/** Destructor. */
virtual ~DirectoryCollection() ;
protected:
mutable bool _entries_loaded ;
bool _recursive ; // recurse into subdirs.
FilePath _filepath ;
void loadEntries() const ;
void load( bool recursive, const FilePath &subdir = FilePath() ) ;
};
} // namespace
#endif
/** \file
Header file that defines DirectoryCollection.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,307 +0,0 @@
#ifndef fcoll_H
#define fcoll_H
#include "zipios++/zipios-config.h"
#include <vector>
#include <string>
#include "zipios++/fcollexceptions.h"
#include "zipios++/fileentry.h"
namespace zipios {
using std::vector;
/** \anchor fcoll_anchor
FileCollection is an abstract baseclass that represents a
collection of files. The specializations of FileCollection
represents different origins of file collections, such as
directories, simple filename lists and compressed archives. */
class FileCollection {
public:
/** FileCollection constructor. */
explicit FileCollection()
: _filename( "-" ),
_entries ( 0 ),
_valid ( false ) {}
/** Copy constructor. */
inline FileCollection( const FileCollection &src ) ;
/** Copy assignment operator. */
inline const FileCollection &operator= ( const FileCollection &src ) ;
/** Closes the FileCollection. */
virtual void close() = 0 ;
/** \anchor fcoll_entries_anchor
Returns a vector of const pointers to the entries in the
FileCollection.
@return a ConstEntries
containing the entries of the FileCollection.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual ConstEntries entries() const ;
enum MatchPath { IGNORE, MATCH } ;
/** \anchor fcoll_getentry_anchor
Returns a ConstEntryPointer to a FileEntry object for the entry
with the specified name. To ignore the path part of the filename in search of a
match, specify FileCollection::IGNORE as the second argument.
@param name A string containing the name of the entry to get.
@param matchpath Speficy MATCH, if the path should match as well,
specify IGNORE, if the path should be ignored.
@return A ConstEntryPointer to the found entry. The returned pointer
equals zero if no entry is found.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual ConstEntryPointer getEntry( const string &name,
MatchPath matchpath = MATCH ) const ;
/** \anchor fcoll_getinputstream
Returns a pointer to an opened istream for the specified
FileEntry. It is the callers responsibility to delete the stream
when he is done with it. Returns 0, if there is no such
FileEntry in the FileCollection.
@param entry A ConstEntryPointer to the FileEntry to get an istream to.
@return an open istream for the specified entry. The istream is allocated on
heap and it is the users responsibility to delete it when he is done with it.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual istream *getInputStream( const ConstEntryPointer &entry ) = 0 ;
/** Returns a pointer to an opened istream for the specified
entry name. It is the callers responsibility to delete the stream
when he is done with it. Returns 0, if there is no entry with the specified
name in the FileCollection.
@param matchpath Speficy MATCH, if the path should match as well,
specify IGNORE, if the path should be ignored.
@return an open istream for the specified entry. The istream is allocated on
heap and it is the users responsibility to delete it when he is done with it.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual istream *getInputStream( const string &entry_name,
MatchPath matchpath = MATCH ) = 0 ;
/** Returns the name of the FileCollection.
@return the name of the FileCollection.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual string getName() const ;
/** Returns the number of entries in the FileCollection.
@return the number of entries in the FileCollection.
@throw InvalidStateException Thrown if the collection is invalid. */
virtual int size() const ;
/** The member function returns true if the collection is valid.
@return true if the collection is valid.
*/
bool isValid() const { return _valid ; }
/** Create a heap allocated clone of the object this method is called for. The
caller is responsible for deallocating the clone when he is done with it.
@return A heap allocated copy of the object this method is called for.
*/
virtual FileCollection *clone() const = 0 ;
/** FileCollection destructor. */
virtual ~FileCollection () ;
protected:
string _filename ;
Entries _entries ;
bool _valid ;
};
//
// Inline methods
//
FileCollection::FileCollection( const FileCollection &src )
: _filename( src._filename ),
_valid ( src._valid )
{
_entries.reserve( src._entries.size() ) ;
Entries::const_iterator it ;
for ( it = src._entries.begin() ; it != src._entries.end() ; ++it )
_entries.push_back( (*it)->clone() ) ;
}
const FileCollection &FileCollection::operator= ( const FileCollection &src ) {
if ( this != &src ) {
_filename = src._filename ;
_valid = src._valid ;
_entries.clear() ;
_entries.reserve( src._entries.size() ) ;
Entries::const_iterator it ;
for ( it = src._entries.begin() ; it != src._entries.end() ; ++it )
_entries.push_back( (*it)->clone() ) ;
}
return *this ;
}
inline ostream & operator<< (ostream &os, const FileCollection& collection) {
os << "collection '" << collection.getName() << "' {" ;
ConstEntries entries = collection.entries();
ConstEntries::const_iterator it;
bool isFirst=true;
for (it=entries.begin(); it != entries.end(); ++it) {
if(! isFirst)
os << ", ";
isFirst = false;
os << (*it)->getName();
}
os << "}";
return os;
}
} // namespace
#endif
/**
\mainpage Zipios++
\image html zipios++.jpg
\image latex zipios++.eps width=10cm
\section intro Introduction
Zipios++ is a java.util.zip-like C++ library for reading and
writing Zip files. Access to individual entries is provided through
standard C++ iostreams. A simple read-only virtual file system that
mounts regular directories and zip files is also provided.
The source code is released under the <A
HREF="http://www.gnu.org/copyleft/lesser.html">GNU Lesser General Public
License</A>.
\section status Status
Spanned archives are not supported, and support is not planned.
The library has been tested and appears to be working with
<UL>
<LI><A HREF="http://www.freebsd.org/ports/archivers.html#zipios++-0.1.5">FreeBSD stable and current / gcc 2.95.3</A></LI>
<LI>Red Hat Linux release 7.0 / gcc 2.96</LI>
<LI>Red Hat Linux release 6.2 (Zoot) / egcs-2.91.66</LI>
<LI>Linux Mandrake release 7.0 (Air) / gcc 2.95.2</LI>
<LI>SGI IRIX64 6.5 / gcc 2.95.2</LI>
<LI>SGI IRIX64 6.5 / MIPSpro Compilers: Version 7.30</LI>
</UL>
If you are aware of any other platforms that Zipios++ works on,
please let me know (thomass@deltadata.dk).
\section documentation Documentation
This web page is the front page to the library documentation which
is generated from the source files using <A
HREF="http://www.stack.nl/~dimitri/doxygen/index.html">Doxygen</A>. Use
the links at the top of the page to browse the API
documentation. The documentation is also available in
a printer-friendly format <A HREF="refman.pdf">[pdf]</A>.
\subsection zipfiles Zip file access
The two most important classes are \ref zipfile_anchor "ZipFile" and
\ref ZipInputStream_anchor "ZipInputStream". ZipInputStream is an istream
for reading zipfiles. It can be instantiated directly, without the
use of ZipFile. A new ZipInputStream reads from the first entry, and
the user can skip to the next entry by calling
\ref ZipInputStream_getnextentry_anchor "ZipInputStream::getNextEntry()".
ZipFile scans the central directory of a zipfile and provides an
interface to access that directory. The user may search for entries
with a particular filename using \ref fcoll_getentry_anchor "ZipFile::getEntry()",
or simply get the complete list of entries
with \ref fcoll_entries_anchor "ZipFile::entries()". To get an
istream (ZipInputStream) to a particular entry simply use
\ref fcoll_getinputstream "ZipFile::getInputStream()".
\ref example_zip_anchor "example_zip.cpp" demonstrates the central
elements of Zipios++.
A Zip file appended to another file, e.g. a binary program, with the program
\ref appendzip_anchor "appendzip", can be read with
\ref zipfile_openembeddedzipfile "ZipFile::openEmbeddedZipFile()".
\subsection filecollections FileCollections
A ZipFile is actually just a special kind of
\ref fcoll_anchor "FileCollection" that
obtains its entries from a .zip Zip archive. Zipios++ also implements
a \ref dircol_anchor "DirectoryCollection" that obtains its entries
from a specified directory, and a \ref collcoll_anchor "CollectionCollection"
that obtains its entries from
other collections. Using a single CollectionCollection any number of
other FileCollections can be placed under its control and accessed
through the same single interface that is used to access a ZipFile or
a DirectoryCollection. A singleton (a unique global instance)
CollectionCollection can be obtained through
\ref collcoll_inst_anchor "CollectionCollection::inst()" ;
To save typing CollectionCollection has been typedef'ed to CColl. In
the initialization part of an application FileCollections can be
created, and placed under CColll::inst()'s control using
\ref collcoll_addcoll_anchor "CColl::inst().addCollection()"
and later an istream can be obtained using
\ref fcoll_getinputstream "CColl::inst().getInputStream()".
\section download Download
Go to Zipios++ project page on SourceForge for tar balls and ChangeLog.
<A HREF="http://sourceforge.net/project/?group_id=5418" >
http://sourceforge.net/project/?group_id=5418</A>
\section links Links
<A HREF="ftp://ftp.freesoftware.com/pub/infozip/zlib/zlib.html">zlib</A>.
The compression library that Zipios++ uses to perform the actual
decompression.
<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/index.html">
Java 2 Platform, Standard Edition, v 1.3 API Specification
</A>. Zipios++ is heavily inspired by the java.util.zip package.
<A
HREF="http://www.geocities.com/SiliconValley/Lakes/2160/fformats/files/zip.txt">
PKWARE zip format
</A>. A description of the zip file format.
\section bugs Bugs
Submit bug reports and patches to thomass@deltadata.dk
\htmlonly
Project hosted by <A HREF="http://sourceforge.net">
<img src="http://sourceforge.net/sflogo.php?group_id=5418&type=1" >
</A><p>
Logo created with <A HREF="http://www.webgfx.ch/titlepic.htm">
<img src="webgfx.gif" >
</A>
\endhtmlonly */
/** \file
Header file that defines FileCollection.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,100 +0,0 @@
#ifndef FCOLLEXCEPTIONS_H
#define FCOLLEXCEPTIONS_H
#include "zipios++/zipios-config.h"
#include <stdexcept>
#include <string>
namespace zipios {
using std::string ;
using std::exception ;
/** An IOException is used to signal an I/O error.
*/
class IOException : public exception {
public:
IOException() throw () ;
explicit IOException( const string &msg ) throw () ;
IOException( const IOException &src ) throw () ;
IOException &operator= ( const IOException &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~IOException() throw () ;
private:
string _what ;
};
/** An FCollException is used to signal a problem with a
FileCollection. */
class FCollException : public exception {
public:
FCollException() throw () ;
explicit FCollException( const string &msg ) throw () ;
FCollException( const FCollException &src ) throw () ;
FCollException &operator= ( const FCollException &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~FCollException() throw () ;
private:
string _what ;
};
/** An object member function may throw this exception, if the
operation it normally performs is inappropriate or impossible to
perform because of the current state of the object. */
class InvalidStateException : public exception {
public:
InvalidStateException() throw () ;
explicit InvalidStateException( const string &msg ) throw () ;
InvalidStateException( const InvalidStateException &src ) throw () ;
InvalidStateException &operator= ( const InvalidStateException &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~InvalidStateException() throw () ;
private:
string _what ;
};
/** Basic exception */
class Exception : public exception {
public:
Exception() throw () ;
explicit Exception( const string &msg ) throw () ;
Exception( const Exception &src ) throw () ;
Exception &operator= ( const Exception &src ) throw () ;
virtual const char *what() const throw () ;
virtual ~Exception() throw () ;
private:
string _what ;
};
} // namespace
#endif
/** \file
Header file that defines a number of exceptions used by FileCollection and
its subclasses.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,240 +0,0 @@
#ifndef FILEENTRY_H
#define FILEENTRY_H
#include "zipios++/zipios-config.h"
#include <string>
#include <vector>
#include "zipios++/meta-iostreams.h"
#include "zipios++/simplesmartptr.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
using std::vector ;
using std::ostream ;
using std::istream ;
using std::string ;
/** The types used with FileEntry::setMethod and
FileEntry::getMethod. The current entries are the types supported
by the zip format. The numbering also matches the numbering used
in the zip file format, ie STORED is indicated by a 0 in the
method field in a zip file and so on. */
enum StorageMethod { STORED = 0, SHRUNK, REDUCED1, REDUCED2,
REDUCED3, REDUCED4, IMPLODED, RESERVED,
DEFLATED } ;
class FileEntry ;
/** \typedef typedef SimpleSmartPointer< FileEntry > EntryPointer
EntryPointer is a SimpleSmartPointer for FileEntry's. */
typedef SimpleSmartPointer< FileEntry > EntryPointer ;
/** ConstEntryPointer is a SimpleSmartPointer for const FileEntry's. */
typedef SimpleSmartPointer< const FileEntry > ConstEntryPointer ;
/** Entries is a vector of EntryPointer's */
typedef vector< EntryPointer > Entries ;
/** ConstEntries is a vector of ConstEntryPointer's */
typedef vector< EntryPointer > ConstEntries ;
/** A FileEntry represents an entry in a FileCollection. The interface
is a copy of the ZipEntry interface from the java.util.zip
package. The name has been changed to FileEntry, as FileCollection
is a more general abstraction, that covers other types of file
collections than just zip files. */
class FileEntry {
public:
/* Default construcotr, copy constructor and copy assignment
operator are sufficient. */
/** Returns the comment of the entry, if it has one. Otherwise it
returns an empty string.
@return the comment associated with the entry, if there is one.
*/
virtual string getComment() const = 0 ;
/** Returns the compressed size of the entry. If the entry is not
stored in a compressed format, the uncompressed size is
returned.
@return the compressed size of the entry. If the entry is stored without
compression the uncompressed size is returned.
*/
virtual uint32 getCompressedSize() const = 0 ;
/** Returns the Crc for the entry, if it has one. FIXME: what is
returned if it doesn't have one?
@return the Crc for the entry, if it has one.
*/
virtual uint32 getCrc() const = 0 ;
/** Returns a vector of bytes of extra data that may be stored with
the entry.
@return A vector< unsigned char > of extra bytes that may potentially
be associated with an entry.
*/
virtual vector< unsigned char > getExtra() const = 0 ;
/** Returns the method used to store the entry in the FileCollection.
@return the storage method used to store the entry in the collection.
@see StorageMethod.
*/
virtual StorageMethod getMethod() const = 0 ;
/** Returns the full filename of the entry, including a path if the
entry is stored in a subfolder.
@return the filename of the entry, including path if the entry is stored
in a sub-folder.
*/
virtual string getName() const = 0 ;
/** Returns the filename of the entry.
@return Returns the filename of the entry.
*/
virtual string getFileName() const = 0 ;
/** Returns the (uncompressed) size of the entry data.
@return Returns the (uncompressed) size of the entry.
*/
virtual uint32 getSize() const = 0 ;
/** Returns the date and time of FIXME: what?
@return the date and time of the entry.
*/
virtual int getTime() const = 0 ;
/** Any method or operator that initializes a FileEntry may set a
flag, that specifies whether the read entry is valid or not. If
it isn't this method returns false.
@return true if the FileEntry has been parsed succesfully.
*/
virtual bool isValid() const = 0 ;
// virtual int hashCode() const = 0 ;
/** Returns true if the entry is a directory. A directory entry is
an entry which name ends with a separator ('/' for Unix systems,
'\' for Windows and DOS systems.
@return true if the entry is a directory.
*/
virtual bool isDirectory() const = 0 ;
/** Sets the comment field for the FileEntry.
@param comment string with the new comment.
*/
virtual void setComment( const string &comment ) = 0 ;
/** Set the compressed size field of the entry.
@param size value to set the compressed size field of the entry to.
*/
virtual void setCompressedSize( uint32 size ) = 0 ;
/** Sets the crc field.
@param crc value to set the crc field to.
*/
virtual void setCrc( uint32 crc ) = 0 ;
/** Sets the extra field.
@param extra the extra field is set to this value.
*/
virtual void setExtra( const vector< unsigned char > &extra ) = 0 ;
/** Sets the storage method field for the entry.
@param method the method field is set to the specified value.
*/
virtual void setMethod( StorageMethod method ) = 0 ;
/** Sets the name field for the entry.
@param name the name field is set to the specified value.
*/
virtual void setName( const string &name ) = 0 ;
/** Sets the size field for the entry.
@param size the size field is set to this value.
*/
virtual void setSize( uint32 size ) = 0 ;
/** Sets the time field for the entry.
@param time the time field is set to the specified value.
*/
virtual void setTime( int time ) = 0 ;
/** Returns a human-readable string representation of the entry.
@return a human-readable string representation of the entry.
*/
virtual string toString() const = 0 ;
/** Create a heap allocated clone of the object this method is called for. The
caller is responsible for deallocating the clone when he is done with it.
@return A heap allocated copy of the object this method is called for.
*/
virtual FileEntry *clone() const = 0 ;
/** FileEntry destructor. */
virtual ~FileEntry() {}
// protected:
class MatchName ;
class MatchFileName ;
protected:
friend class SimpleSmartPointer< FileEntry > ;
friend class SimpleSmartPointer< const FileEntry > ;
void ref() const { _refcount.ref() ; }
unsigned int unref() const { return _refcount.unref() ; }
ReferenceCount< FileEntry > _refcount ;
};
/** Function object to be used with the STL find_if algorithm to
find a FileEntry in a container, which name (as obtained with
FileEntry::getName()) is identical to the name specified in the
MatchName constructor. */
class FileEntry::MatchName {
public:
explicit MatchName( const string &name ) : _name( name ) {}
bool operator() ( const ConstEntryPointer &entry ) {
return entry->getName() == _name ;
}
private:
string _name ;
};
/** Function object to be used with the STL find_if algorithm to
find a FileEntry in a container, which name (as obtained with
FileEntry::getFileName()) is identical to the name specified in the
MatchName constructor. */
class FileEntry::MatchFileName {
public:
explicit MatchFileName( const string &name ) : _name( name ) {}
bool operator() ( const ConstEntryPointer &entry ) {
return entry->getFileName() == _name ;
}
private:
string _name ;
};
ostream &operator<< ( ostream &os, const FileEntry &entry ) ;
inline ostream &operator<< ( ostream &os, const ConstEntryPointer &entry ) {
os << *entry ;
return os ;
}
} // namespace
#endif
/** \file
Header file that defines FileEntry.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,202 +0,0 @@
#ifndef FILEPATH_H
#define FILEPATH_H
#include "zipios++/zipios-config.h"
#include <stdexcept>
#include <string>
namespace zipios {
using namespace std ;
/** FilePath represents a path to a file or directory name. FilePath has
member functions to check if the file path is a valid file system entity,
and to check what kind of file system entity it is, e.g. is it a file, a
directory, a pipe etc.
*/
class FilePath {
public:
/** Constructor.
@param path A string representation of the path.
@param check_exists If true is specified the constructor will
check the existence and type of the path immidiately, instead of
deferring that task until it is needed. */
FilePath( const string &path = "", bool check_exists = false ) ;
inline FilePath &operator= ( const string &rhs ) ;
inline operator string() const ;
/** Concatenates FilePath objects. A file separator is inserted
if appropriate. */
inline FilePath operator+ ( const FilePath &name ) const ;
/** Returns filename of the FilePath object by pruning the path
off. */
inline FilePath filename() const ;
/** @return true If the path is a valid file system entity. */
inline bool exists() const ;
/** @return true if the path is a regular file. */
inline bool isRegular() const ;
/** @return true if the path is a directory. */
inline bool isDirectory() const ;
/** @return true if the path is character special (a character
device file). */
inline bool isCharSpecial() const ;
/** @return true if the path is block special (a block device
file). */
inline bool isBlockSpecial() const ;
/** @return true if the path is a socket. */
inline bool isSocket() const ;
/** @return true if the path is a Fifo (a pipe). */
inline bool isFifo() const ;
protected:
/** Prunes the trailing separator of a specified path. */
inline void pruneTrailingSeparator() ;
/** This function sets _checked to true, stats the path, to see if
it exists and to determine what type of file it is. All the query
functions check if _checked is true, and if it isn't they call
check(). This means stat'ing is deferred until it becomes
necessary. */
void check() const ;
static const char _separator;
// FIXME: Should be bitfield
mutable bool _checked ;
mutable bool _exists ;
mutable bool _is_reg ;
mutable bool _is_dir ;
mutable bool _is_char ;
mutable bool _is_block ;
mutable bool _is_socket ;
mutable bool _is_fifo ;
string _path ;
};
//
// Inline member functions
//
FilePath &FilePath::operator= ( const string &rhs ) {
_path = rhs ;
pruneTrailingSeparator() ;
return *this ;
}
void FilePath::pruneTrailingSeparator() {
if ( _path.size() > 0 )
if ( _path[ _path.size() -1 ] == _separator )
_path.erase( _path.size() - 1 ) ;
}
FilePath::operator string() const {
return _path ;
}
FilePath FilePath::operator+ ( const FilePath &name ) const {
if ( _path.size() > 0 )
return _path + _separator + name._path ;
else
return name._path ;
}
FilePath FilePath::filename() const {
string::size_type pos ;
pos = _path.find_last_of( _separator ) ;
if ( pos != string::npos )
return _path.substr( pos + 1);
else
return _path ;
}
bool FilePath::exists() const {
if ( ! _checked )
check() ;
return _exists ;
}
bool FilePath::isRegular() const {
if ( ! _checked )
check() ;
return _is_reg ;
}
bool FilePath::isDirectory() const {
if ( ! _checked )
check() ;
return _is_dir ;
}
bool FilePath::isCharSpecial() const {
if ( ! _checked )
check() ;
return _is_char ;
}
bool FilePath::isBlockSpecial() const {
if ( ! _checked )
check() ;
return _is_block ;
}
bool FilePath::isSocket() const {
if ( ! _checked )
check() ;
return _is_socket ;
}
bool FilePath::isFifo() const {
if ( ! _checked )
check() ;
return _is_fifo ;
}
} // namespace
#endif
/** \file
Header file that defines FilePath.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,66 +0,0 @@
#ifndef FILTERINPUTSTREAMBUF_H
#define FILTERINPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
namespace zipios {
using std::streambuf ;
/** An input streambuf filter is a streambuf that filters the input it
gets from the streambuf it is attached to. FilterInputStreambuf is a base class to
derive input streambuf filters from. */
class FilterInputStreambuf : public streambuf {
public:
/** Constructor.
@param inbuf the streambuf to use for input.
@param del_inbuf if true is specified inbuf will be deleted, when
the FilterInputStreambuf is destructed.
*/
explicit FilterInputStreambuf( streambuf *inbuf, bool del_inbuf = false ) ;
/** Destructor. */
virtual ~FilterInputStreambuf() ;
protected:
int _s_pos ; // Position in this streambuf - FIXME: is this used?
streambuf *_inbuf ;
bool _del_inbuf ;
private:
/** Copy-constructor is private to prevent copying. */
FilterInputStreambuf( const FilterInputStreambuf &src ) ;
/** Copy-assignment operator is private to prevent copying. */
const FilterInputStreambuf &operator= ( const FilterInputStreambuf &src ) ;
};
} // namespace
#endif
/** \file
Header file that defines FilterInputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,58 +0,0 @@
#ifndef FILTEROUTPUTSTREAMBUF_H
#define FILTEROUTPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
namespace zipios {
using std::streambuf ;
/** A FilterOutputStreambuf is a streambuf that filters the data that is written
to it before it passes it on to the output streambuf it is connected to. */
class FilterOutputStreambuf : public streambuf {
public:
/** Constructor.
@param outbuf the streambuf to pass the filtered data on to.
@param del_outbuf if true is specified outbuf will be deleted, when
the FilterOutputStreambuf is destructed. */
explicit FilterOutputStreambuf( streambuf *outbuf, bool del_outbuf = false ) ;
/** Destructor. */
virtual ~FilterOutputStreambuf() ;
protected:
streambuf *_outbuf ;
bool _del_outbuf ;
};
} // namespace
#endif
/** \file
Header file that defines FilterOutputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,71 +0,0 @@
#ifndef GZIPOUTPUTSTREAM_H
#define GZIPOUTPUTSTREAM_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include "zipios++/gzipoutputstreambuf.h"
namespace zipios {
/** \anchor GZIPOutputStream_anchor
GZIPOutputStream is an ostream that writes the output to a gz file. The
interface approximates the interface of the Java GZIPOutputStream. */
class GZIPOutputStream : public std::ostream {
public:
/** GZIPOutputStream constructor.
@param os ostream to which the compressed zip archive is written.
*/
explicit GZIPOutputStream( std::ostream &os ) ;
/** GZIPOutputStream constructor.
@filename filename to write the gzip archive to. */
explicit GZIPOutputStream( const std::string &filename ) ;
void setFilename( const string &filename );
void setComment( const string &comment );
/** Calls finish and closes the stream. */
void close() ;
/** Finishes the stream. */
void finish() ;
/** Destructor. */
virtual ~GZIPOutputStream() ;
private:
std::ofstream *ofs ;
GZIPOutputStreambuf *ozf ;
};
} // namespace.
#endif
/** \file
Header file that defines GZIPOutputStream.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,79 +0,0 @@
#ifndef GZIPOUTPUTSTREAMBUF_H
#define GZIPOUTPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include <vector>
#include <HepRep-zlib.h>
#include "zipios++/deflateoutputstreambuf.h"
namespace zipios {
/** GZIPOutputStreambuf is a zip output streambuf filter. */
class GZIPOutputStreambuf : public DeflateOutputStreambuf {
public:
/** GZIPOutputStreambuf constructor. A newly constructed GZIPOutputStreambuf
is ready to accept data.
@param outbuf the streambuf to use for output.
@param del_outbuf if true is specified outbuf will be deleted, when
the GZIPOutputStreambuf is destructed. */
explicit GZIPOutputStreambuf( streambuf *outbuf, bool del_outbuf = false ) ;
void setFilename( const string &filename );
void setComment( const string &comment );
/** Calls finish. */
void close() ;
/** Finishes the compression. */
void finish() ;
/** Destructor. */
virtual ~GZIPOutputStreambuf() ;
protected:
virtual int overflow( int c = EOF ) ;
virtual int sync() ;
private:
void writeHeader();
void writeTrailer();
void writeInt(uint32 i);
std::string _filename;
std::string _comment;
bool _open ;
};
} // namespace
#endif
/** \file
Header file that defines ZipOutputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,89 +0,0 @@
#ifndef INFLATEINPUTSTREAMBUF_H
#define INFLATEINPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <vector>
#include <HepRep-zlib.h>
#include "zipios++/filterinputstreambuf.h"
namespace zipios {
using std::vector ;
/** InflateInputStreambuf is an input stream filter, that inflates the input
from the attached input stream. Deflation/Inflation is a
compression/decompression method used in gzip and zip. The zlib
library is used to perform the actual inflation, this class only
wraps the functionality in an input stream filter. */
class InflateInputStreambuf : public FilterInputStreambuf {
public:
/** InflateInputStreambuf constructor.
@param inbuf the streambuf to use for input.
@param s_pos a position to reset the inbuf to before reading. Specify
-1 to read from the current position.
@param del_inbuf if true is specified inbuf will be deleted, when
the InflateInputStreambuf is destructed.
*/
explicit InflateInputStreambuf( streambuf *inbuf, int s_pos = -1, bool del_inbuf = false ) ;
virtual ~InflateInputStreambuf() ;
/** Resets the zlib stream and purges input and output buffers.
repositions the input streambuf at stream_position.
@param stream_position a position to reset the inbuf to before reading. Specify
-1 to read from the current position.
*/
bool reset( int stream_position = -1 ) ;
protected:
virtual int underflow() ;
private:
z_stream _zs ;
bool _zs_initialized ;
const int _invecsize ;
vector< char > _invec ;
protected: // FIXME: reconsider design?
const int _outvecsize ;
vector< char > _outvec ;
private:
/** Copy-constructor is private to prevent copying. */
InflateInputStreambuf( const InflateInputStreambuf &src ) ;
/** Copy-assignment operator is private to prevent copying. */
const InflateInputStreambuf &operator= ( const InflateInputStreambuf &src ) ;
};
} // namespace
#endif
/** \file
Header file that defines InflateInputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,17 +0,0 @@
#ifndef META_IOSTREAMS_H
#define META_IOSTREAMS_H
// Includes the different iostream libraries
#include "zipios++/zipios-config.h"
#include <iostream>
#include <fstream>
#if defined (HAVE_STD_IOSTREAM) && defined (USE_STD_IOSTREAM)
#include <sstream>
#else
#include <strstream>
#endif
#endif
@@ -1,71 +0,0 @@
#ifndef OUTPUTSTRINGSTREAM_H
#define OUTPUTSTRINGSTREAM_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
namespace zipios {
#if defined (HAVE_STD_IOSTREAM) && defined (USE_STD_IOSTREAM)
typedef std::ostringstream OutputStringStream ;
#else
#include <strstream>
/** OutputStringStream is typedefed to ostringstream if sstream is
part of the standard library (unless Zipios++ has been explicitly
configured not to use it). If sstream is not present
OutputStringStream is a subclass of ostrstream from
strstream.h. In this case OutputStringStream specializes the str()
method, such that the caller does not have to concern himself with
null-terminating the string and unfreezing the ostrstream. */
class OutputStringStream : public std::ostrstream {
public:
/** Specialization of ostrstream::str() that takes care of
null-terminating the string and unfreezing the ostrstream. */
inline string str() {
*this << std::ends ; // null terminate ostrstream
string o_str( std::ostrstream::str() ) ;
freeze( 0 ) ;
return o_str ;
}
private:
// To avoid invoking such a member function in the base
// class if there is one!
string str() const ;
};
#endif
} // namespace
#endif
/** \file
Header file that defines OutputStringStream.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,173 +0,0 @@
#ifndef SIMPLESMARTPTR_H
#define SIMPLESMARTPTR_H
#include "zipios++/zipios-config.h"
namespace zipios {
/** SimpleSmartPointer is a simple reference counting smart pointer
template. The type pointed to must keep a reference count that is
accessible through the two methods void ref() const and unsigned
int unref() const. The type must also handle the reference count
properly. The easiest way to do that is to use the ReferenceCount
template class. */
template< class Type >
class SimpleSmartPointer {
public:
Type *operator-> () const { return _p ; }
Type &operator* () const { return *_p ; }
SimpleSmartPointer( Type *p = 0 ) : _p( p ) { ref() ; }
template< class T2 > SimpleSmartPointer( const SimpleSmartPointer< T2 > &src )
: _p( src.get() ) { ref() ; }
SimpleSmartPointer( const SimpleSmartPointer &src ) : _p( src.get() ) {
ref() ;
}
~SimpleSmartPointer () { if ( unref() == 0 ) deleteIt() ; }
template< class T2 >
SimpleSmartPointer &operator= ( const SimpleSmartPointer< T2 > &src ) {
ref( src.get() ) ;
if ( unref() == 0 )
deleteIt() ;
_p = src.get() ;
return *this ;
}
SimpleSmartPointer &operator= ( const SimpleSmartPointer &src ) {
ref( src.get() ) ;
if ( unref() == 0 )
deleteIt() ;
_p = src.get() ;
return *this ;
}
SimpleSmartPointer &operator=( Type *src ) {
_p = src ;
ref() ;
return *this ;
}
bool operator== ( const Type *p ) const { return _p == p ; }
bool operator!= ( const Type *p ) const { return _p != p ; }
bool operator== ( const SimpleSmartPointer &sp ) const { return _p == sp.get() ; }
bool operator!= ( const SimpleSmartPointer &sp ) const { return _p != sp.get() ; }
bool operator! () const { return ! _p ; }
// This next method is inspired by iostream, and is for use with
// if ( some_smart_pointer ).
operator void*() const { return _p ? (void *)(-1) : (void *)(0) ; }
Type *get() const { return _p ; }
/** Returns the reference count - For debugging purposes. */
unsigned int getReferenceCount() const { return _p->getReferenceCount(); }
private:
template< class T2 >
void ref( const T2 *ptr ) { if ( ptr ) ptr->ref() ; }
void ref() const { if ( _p ) _p->ref() ; }
unsigned int unref() const {
if ( _p )
return _p->unref();
else
return 0 ;
}
void deleteIt() {
// if( _p )
// cerr << "SimpleSmartPointer: Deleting object!" << endl ;
delete _p ;
}
Type *_p ;
};
/** ReferenceCount is useful to ensure proper handling of the
reference count for (objects of) classes handled through a
SimpleSmartPointer. Subclassing ReferenceCount is all a class
needs to become ready for being handled by
SimpleSmartPointer. Another way is to add a ReferenceCount member
variable to a class and write two methods 'void ref() const' and
'unsigned int unref() const' that invoke the same methods in the
ReferenceCount variable. */
template< class Type >
class ReferenceCount {
/** SimpleSmartPointer needs to be a friend to invoke the private
ref() and unref() methods. */
friend class SimpleSmartPointer< Type > ;
friend class SimpleSmartPointer< const Type > ;
/** Type also needs to be a friend to invoke the private ref() and
unref() methods, in case Type doesn't want to inherit
ReferenceCount and thus needs to invoke ref() and unref()
through forwarding member functions. */
//
// Originally the following template parameter was made a friend.
// This is not allowed by the standard so comment it out:
//
// friend Type ;
//
// Initially hack things by making the necessary classes friends
// even though we don't know really which they are. This is an
// Hideous Hack.
friend class FileEntry ;
friend class Bogus ;
public:
/** Constructor intializes count to zero. */
ReferenceCount() : _ref_count( 0 ) {}
/** Copy-constructor intializes count to zero. It doesn't copy it
from src. */
ReferenceCount( const ReferenceCount &/*MD:src*/ ) : _ref_count( 0 ) {}
/** The assignment operator doesn't copy the reference count, it
leaves it unchanged. */
const ReferenceCount &operator= ( const ReferenceCount &src ) { return *this; }
private:
/** Increases the reference count. */
void ref() const { ++_ref_count ; }
/** Decreases the reference count. */
unsigned int unref() const { return --_ref_count ; }
/** Returns the reference count - For debugging purposes. */
unsigned int getReferenceCount() const { return _ref_count; }
/** Holds the actual reference count */
mutable unsigned short _ref_count ;
};
} // namespace
#endif
/** \file
Header file that defines SimpleSmartPointer and ReferenceCount.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,105 +0,0 @@
#ifndef VIRTUALSEEKER_H
#define VIRTUALSEEKER_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
namespace zipios {
using std::ios ;
using std::cerr ;
using std::endl ;
/** VirtualSeeker is a simple class that keeps track of a set of
specified 'virtual' file endings that mark a subset of a real
file. An example of its use (and its reason for existence) is to
keep track of the file endings of a Zip file embedded in another
file. */
class VirtualSeeker {
public:
inline VirtualSeeker( int start_offset = 0, int end_offset = 0) ;
inline void setOffsets( int start_offset, int end_offset ) ;
inline void getOffsets( int &start_offset, int &end_offset ) const ;
inline int startOffset() const ;
inline int endOffset() const ;
inline void vseekg( istream &is, int offset, ios::seekdir sd ) const ;
inline int vtellg( istream &is ) const ;
private:
// start and end offsets
int _s_off, _e_off ;
};
VirtualSeeker::VirtualSeeker( int start_offset, int end_offset )
: _s_off( start_offset ),
_e_off( end_offset )
{}
void VirtualSeeker::setOffsets( int start_offset, int end_offset ) {
_s_off = start_offset ;
_e_off = end_offset ;
}
void VirtualSeeker::getOffsets( int &start_offset, int &end_offset ) const {
start_offset = _s_off ;
end_offset = _e_off ;
}
int VirtualSeeker::startOffset() const {
return _s_off ;
}
int VirtualSeeker::endOffset() const {
return _e_off ;
}
void VirtualSeeker::vseekg( istream &is, int offset, ios::seekdir sd ) const {
if ( sd == ios::cur )
is.seekg( offset, sd ) ;
else if ( sd == ios::beg )
is.seekg( offset + _s_off, sd ) ;
else if ( sd == ios::end )
is.seekg( offset - _e_off, sd ) ;
else
cerr << "VirtualSeekManager::seekg: error - not supposed to happen!" << endl ;
}
int VirtualSeeker::vtellg( istream &is ) const {
return static_cast< int >( is.tellg() ) - _s_off ;
}
} // namespace
#endif
/** \file
Header file that defines VirtualSeeker.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,105 +0,0 @@
#ifndef ZIPFILE_H
#define ZIPFILE_H
#include "zipios++/zipios-config.h"
#include <vector>
#include "zipios++/meta-iostreams.h"
#include "zipios++/fcoll.h"
#include "zipios++/ziphead.h"
#include "zipios++/virtualseeker.h"
namespace zipios {
using std::ifstream ;
/** \anchor zipfile_anchor
ZipFile is a FileCollection, where the files are stored
in a .zip file. */
class ZipFile : public FileCollection {
public:
/** \anchor zipfile_openembeddedzipfile
Opens a Zip archive embedded in another file, by writing the zip
archive to the end of the file followed by the start offset of
the zip file. The offset must be written in zip-file byte-order
(little endian). The program appendzip, which is part of the
Zipios++ distribution can be used to append a Zip archive to a
file, e.g. a binary program.
@throw FColException Thrown if the specified file name is not a valid zip
archive.
@throw IOException Thrown if an I/O problem is encountered, while the directory
of the specified zip archive is being read. */
static ZipFile openEmbeddedZipFile( const string &name ) ;
/** Default constructor.
*/
ZipFile() {}
/* Default Copy constructor and copy assignment operator are sufficient. */
/** Constructor. Opens the zip file name. If the zip "file" is
embedded in a file that contains other data, e.g. a binary
program, the offset of the zip file start and end must be
specified.
@param name The filename of the zip file to open.
@param s_off Offset relative to the start of the file, that
indicates the beginning of the zip file.
@param e_off Offset relative to the end of the file, that
indicates the end of the zip file. The offset is a positive number,
even though the offset is towards the beginning of the file.
@throw FColException Thrown if the specified file name is not a valid zip
archive.
@throw IOException Thrown if an I/O problem is encountered, while the directory
of the specified zip archive is being read. */
explicit ZipFile( const string &name, int s_off = 0, int e_off = 0
/* , ios::open_mode mode = ios::in | ios::binary */ ) ;
virtual FileCollection *clone() const ;
/** Destructor. */
virtual ~ZipFile() ;
virtual void close() ;
virtual istream *getInputStream( const ConstEntryPointer &entry ) ;
virtual istream *getInputStream( const string &entry_name,
MatchPath matchpath = MATCH ) ;
private:
VirtualSeeker _vs ;
EndOfCentralDirectory _eocd ;
bool init( istream &_zipfile ) ;
bool readCentralDirectory( istream &_zipfile ) ;
bool readEndOfCentralDirectory( istream &_zipfile ) ;
bool confirmLocalHeaders( istream &_zipfile ) ;
void setError( string error_str ) ;
};
}
#endif
/** \file
Header file that defines ZipFile.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,271 +0,0 @@
#ifndef ZIPHEAD_H
#define ZIPHEAD_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include <vector>
#include "zipios++/fileentry.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
using std::streampos ;
class ZipCDirEntry ;
/** A concrete implementation of the abstract FileEntry base class for
ZipFile entries, specifically for representing the information
present in the local headers of file entries in a zip file. */
class ZipLocalEntry : public FileEntry {
friend istream &operator>> ( istream &is, ZipLocalEntry &zcdh ) ;
friend ostream &operator<< ( ostream &os, const ZipLocalEntry &zlh ) ;
friend bool operator== ( const ZipLocalEntry &zlh, const ZipCDirEntry &ze ) ;
public:
inline ZipLocalEntry( const string &_filename = "",
const vector< unsigned char > &_extra_field =
vector< unsigned char >() )
: gp_bitfield( 0 ),
_valid( false ) {
setDefaultExtract() ;
setName( _filename ) ;
setExtra( _extra_field ) ;
}
void setDefaultExtract() ;
inline ZipLocalEntry &operator=( const class ZipLocalEntry &src ) ;
virtual string getComment() const ;
virtual uint32 getCompressedSize() const ;
virtual uint32 getCrc() const ;
virtual vector< unsigned char > getExtra() const ;
virtual StorageMethod getMethod() const ;
virtual string getName() const ;
virtual string getFileName() const ;
virtual uint32 getSize() const ;
virtual int getTime() const ;
virtual bool isValid() const ;
virtual bool isDirectory() const ;
virtual void setComment( const string &comment ) ;
virtual void setCompressedSize( uint32 size ) ;
virtual void setCrc( uint32 crc ) ;
virtual void setExtra( const vector< unsigned char > &extra ) ;
virtual void setMethod( StorageMethod method ) ;
virtual void setName( const string &name ) ;
virtual void setSize( uint32 size ) ;
virtual void setTime( int time ) ;
virtual string toString() const ;
int getLocalHeaderSize() const ;
bool trailingDataDescriptor() const ;
virtual FileEntry *clone() const ;
virtual ~ZipLocalEntry() {}
protected:
static const uint32 signature ;
uint16 extract_version ;
uint16 gp_bitfield ;
uint16 compress_method ;
uint16 last_mod_ftime ;
uint16 last_mod_fdate ;
uint32 crc_32 ;
uint32 compress_size ;
uint32 uncompress_size ;
uint16 filename_len ;
uint16 extra_field_len ;
string filename ;
vector< unsigned char > extra_field ;
bool _valid ;
};
/** A struct containing fields for the entries in a zip file data
descriptor, that trails the compressed data in files that were
created by streaming, ie where the zip compressor cannot seek back
to the local header and store the data. */
struct DataDescriptor {
uint32 crc_32 ;
uint32 compress_size ;
uint32 uncompress_size ;
};
/** Specialization of ZipLocalEntry, that add fields for storing the
extra information, that is only present in the entries in the zip
central directory and not in the local entry headers. */
class ZipCDirEntry : public ZipLocalEntry {
friend istream &operator>> ( istream &is, ZipCDirEntry &zcdh ) ;
friend ostream &operator<< ( ostream &os, const ZipCDirEntry &zcdh ) ;
friend bool operator== ( const ZipLocalEntry &zlh, const ZipCDirEntry &ze ) ;
public:
inline ZipCDirEntry( const string &_filename = "",
const string &_file_comment = "",
const vector< unsigned char > &_extra_field =
vector< unsigned char >() )
: ZipLocalEntry ( _filename, _extra_field ),
disk_num_start ( 0x0 ),
intern_file_attr( 0x0 ),
extern_file_attr( 0x81B40000 )
// FIXME: I don't understand the external mapping, simply
// copied value for a file with -rw-rw-r-- permissions
// compressed with info-zip
{
setComment( _file_comment ) ;
setDefaultWriter() ;
}
void setDefaultWriter() ;
inline ZipCDirEntry &operator=( const class ZipCDirEntry &src ) ;
virtual string toString() const ;
virtual string getComment() const ;
virtual void setComment( const string &comment ) ;
virtual uint32 getLocalHeaderOffset() const ;
virtual void setLocalHeaderOffset( uint32 offset ) ;
int getCDirHeaderSize() const ;
virtual FileEntry *clone() const ;
virtual ~ZipCDirEntry() {}
private:
static const uint32 signature ;
uint16 writer_version ;
uint16 file_comment_len ;
uint16 disk_num_start ;
uint16 intern_file_attr ;
uint32 extern_file_attr ;
uint32 rel_offset_loc_head ;
string file_comment ;
};
/** The end of the Central directory structure. This structure is
stored in the end of the zipfile, and contains information about
the zipfile, including the position of the start of the central
directory. */
class EndOfCentralDirectory {
friend ostream &operator<< ( ostream &os, const EndOfCentralDirectory &eocd ) ;
public:
explicit EndOfCentralDirectory( const string &_zip_comment = "",
uint16 _disk_num = 0, uint16 _cdir_disk_num = 0,
uint16 _cdir_entries = 0,
uint16 _cdir_tot_entries = 0,
uint32 _cdir_size = 0, uint32 _cdir_offset = 0 )
: disk_num ( _disk_num ),
cdir_disk_num ( _cdir_disk_num ),
cdir_entries ( _cdir_entries ),
cdir_tot_entries ( _cdir_tot_entries ),
cdir_size ( _cdir_size ),
cdir_offset ( _cdir_offset ),
zip_comment_len ( _zip_comment.size() ),
zip_comment ( _zip_comment ) {}
uint32 offset() const { return cdir_offset ; }
uint16 totalCount() const { return cdir_tot_entries ; }
void setCDirSize( uint32 size ) { cdir_size = size ; }
void setOffset( uint32 offset ) { cdir_offset = offset ; }
void setTotalCount( uint16 c ) { cdir_entries = c ; cdir_tot_entries = c ; }
int eocdOffSetFromEnd() const { return eocd_offset_from_end ; }
bool read( vector<unsigned char> &buf, int pos ) ;
private:
static const uint32 signature;
uint16 disk_num ;
uint16 cdir_disk_num ;
uint16 cdir_entries ;
uint16 cdir_tot_entries ;
uint32 cdir_size ;
uint32 cdir_offset ;
uint16 zip_comment_len ;
streampos eocd_offset_from_end ; // Not a Zip defined field
string zip_comment;
bool checkSignature( unsigned char *buf ) const ;
inline bool checkSignature( uint32 sig ) const ;
};
bool operator== ( const ZipLocalEntry &zlh, const ZipCDirEntry &ze ) ;
inline bool operator== ( const ZipCDirEntry &ze, const ZipLocalEntry &zlh ) {
return zlh == ze ;
}
inline bool operator!= ( const ZipLocalEntry &zlh, const ZipCDirEntry &ze ) {
return ! ( zlh == ze ) ;
}
inline bool operator!= ( const ZipCDirEntry &ze, const ZipLocalEntry &zlh ) {
return ! ( zlh == ze ) ;
}
// Inline member functions
ZipCDirEntry &ZipCDirEntry::operator=( const class ZipCDirEntry &src ) {
writer_version = src.writer_version ;
extract_version = src.extract_version ;
gp_bitfield = src.gp_bitfield ;
compress_method = src.compress_method ;
last_mod_ftime = src.last_mod_ftime ;
last_mod_fdate = src.last_mod_fdate ;
crc_32 = src.crc_32 ;
compress_size = src.compress_size ;
uncompress_size = src.uncompress_size ;
filename_len = src.filename_len ;
extra_field_len = src.extra_field_len ;
file_comment_len = src.file_comment_len ;
disk_num_start = src.disk_num_start ;
intern_file_attr = src.intern_file_attr ;
extern_file_attr = src.extern_file_attr ;
rel_offset_loc_head = src.rel_offset_loc_head ;
filename = src.filename ;
extra_field = src.extra_field ;
file_comment = src.file_comment ;
return *this ;
}
bool EndOfCentralDirectory::checkSignature ( uint32 sig ) const {
return signature == sig ;
}
} // namespace
#endif
/** \file
Header file containing classes and functions for reading the central
directory and local header fields in a zip archive.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,192 +0,0 @@
#ifndef ZIPHEADIO_H
#define ZIPHEADIO_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include <vector>
#include "zipios++/ziphead.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
// byte order conversion functions.
// ztohs (zip-to-host-short)
#ifdef MY_BIG_ENDIAN
inline uint16 ztohs ( unsigned char *buf ) {
uint16 out ;
// *( reinterpret_cast<unsigned char *>( &out ) ) = *( buf + 1 );
// *( reinterpret_cast<unsigned char *>( &out ) + 1 ) = *( buf );
out = ( static_cast< uint16 >( buf[ 0 ] ) << 8 ) +
( static_cast< uint16 >( buf[ 1 ] ) ) ;
return out;
}
// ztohl (zip-to-host-long)
inline uint32 ztohl ( unsigned char *buf ) {
uint32 out;
out = ( static_cast< uint32 >( buf[ 0 ] ) << 24 ) +
( static_cast< uint32 >( buf[ 1 ] ) << 16 ) +
( static_cast< uint32 >( buf[ 2 ] ) << 8 ) +
( static_cast< uint32 >( buf[ 3 ] ) ) ;
return out;
}
#else
inline uint16 ztohs ( unsigned char *buf ) {
uint16 out ;
out = ( static_cast< uint16 >( buf[ 1 ] ) << 8 ) +
( static_cast< uint16 >( buf[ 0 ] ) ) ;
return out;
}
// ztohl (zip-to-host-long)
inline uint32 ztohl ( unsigned char *buf ) {
uint32 out;
out = ( static_cast< uint32 >( buf[ 3 ] ) << 24 ) +
( static_cast< uint32 >( buf[ 2 ] ) << 16 ) +
( static_cast< uint32 >( buf[ 1 ] ) << 8 ) +
( static_cast< uint32 >( buf[ 0 ] ) ) ;
// cerr << "buf : " << static_cast< int >( buf[ 0 ] ) ;
// cerr << " " << static_cast< int >( buf[ 1 ] ) ;
// cerr << " " << static_cast< int >( buf[ 2 ] ) ;
// cerr << " " << static_cast< int >( buf[ 3 ] ) << endl ;
// cerr << "uint32 " << out << endl ;
return out;
}
#endif
// htozl (host-to-zip-long)
inline uint32 htozl ( unsigned char *buf ) {
return ztohl( buf ) ;
}
// htozs (host-to-zip-short)
inline uint16 htozs ( unsigned char *buf ) {
return ztohs( buf ) ;
}
inline uint32 readUint32 ( istream &is ) {
static const int buf_len = sizeof ( uint32 ) ;
unsigned char buf [ buf_len ] ;
int rsf = 0 ;
while ( rsf < buf_len ) {
is.read ( reinterpret_cast< char * >( buf ) + rsf, buf_len - rsf ) ;
rsf += is.gcount () ;
}
return ztohl ( buf ) ;
}
inline void writeUint32 ( uint32 host_val, ostream &os ) {
uint32 val = htozl( reinterpret_cast< unsigned char * >( &host_val ) ) ;
os.write( reinterpret_cast< char * >( &val ), sizeof( uint32 ) ) ;
}
inline uint16 readUint16 ( istream &is ) {
static const int buf_len = sizeof ( uint16 ) ;
unsigned char buf [ buf_len ] ;
int rsf = 0 ;
while ( rsf < buf_len ) {
is.read ( reinterpret_cast< char * >( buf ) + rsf, buf_len - rsf ) ;
rsf += is.gcount () ;
}
return ztohs ( buf ) ;
}
inline void writeUint16 ( uint16 host_val, ostream &os ) {
uint16 val = htozl( reinterpret_cast< unsigned char * >( &host_val ) ) ;
os.write( reinterpret_cast< char * >( &val ), sizeof( uint16 ) ) ;
}
inline void readByteSeq ( istream &is, string &con, int count ) {
char *buf = new char [ count + 1 ] ;
int rsf = 0 ;
while ( rsf < count && is ) {
is.read ( buf + rsf, count - rsf ) ;
rsf += is.gcount() ;
}
buf [ count ] = '\0' ;
con = buf ;
delete [] buf ;
}
inline void writeByteSeq( ostream &os, const string &con ) {
os << con ;
}
inline void readByteSeq ( istream &is, unsigned char *buf, int count ) {
int rsf = 0 ;
while ( rsf < count && is ) {
is.read ( reinterpret_cast< char * >( buf ) + rsf, count - rsf ) ;
rsf += is.gcount() ;
}
}
inline void writeByteSeq ( ostream &os, const unsigned char *buf, int count ) {
os.rdbuf()->sputn( reinterpret_cast< const char * >( buf ), count ) ;
}
inline void readByteSeq ( istream &is, vector < unsigned char > &vec, int count ) {
unsigned char *buf = new unsigned char [ count ] ;
int rsf = 0 ;
while ( rsf < count && is ) {
is.read ( reinterpret_cast< char * >( buf ) + rsf, count - rsf ) ;
rsf += is.gcount() ;
}
vec.insert ( vec.end (), buf, buf + count ) ;
delete [] buf ;
}
inline void writeByteSeq ( ostream &os, const vector < unsigned char > &vec ) {
os.rdbuf()->sputn( reinterpret_cast< const char * >( &( vec[ 0 ] ) ), vec.size() ) ;
}
istream& operator>> ( istream &is, ZipLocalEntry &zlh ) ;
istream& operator>> ( istream &is, DataDescriptor &dd ) ;
istream& operator>> ( istream &is, ZipCDirEntry &zcdh ) ;
// istream& operator>> ( istream &is, EndOfCentralDirectory &eocd ) ;
ostream &operator<< ( ostream &os, const ZipLocalEntry &zlh ) ;
ostream &operator<< ( ostream &os, const ZipCDirEntry &zcdh ) ;
ostream &operator<< ( ostream &os, const EndOfCentralDirectory &eocd ) ;
} // namespace
#endif
/** \file
Header file that defines I/O functions for the header structures
defined in ziphead.h.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,91 +0,0 @@
#ifndef ZIPINPUTSTREAM_H
#define ZIPINPUTSTREAM_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include "zipios++/ziphead.h"
#include "zipios++/zipinputstreambuf.h"
namespace zipios {
using std::ifstream ;
/** \anchor ZipInputStream_anchor
ZipInputStream is an istream that gets it's input from a zip file. The
interface approximates the interface of the Java
ZipInputStream. */
class ZipInputStream : public istream {
public:
/** ZipInputStream constructor.
@param is istream from which the compressed zip archive can be read.
@param pos position to reposition the istream to before reading. */
explicit ZipInputStream( istream &is, streampos pos = 0 ) ;
/** ZipInputStream constructor.
@filename filename of a valid zip file.
@param pos position to reposition the istream to before reading. */
explicit ZipInputStream( const string &filename, streampos pos = 0 ) ;
int available() ;
/** Closes the current entry, and positions the stream read pointer at
the beginning of the next entry (if there is one). */
void closeEntry() ;
/** Closes the istream. */
void close() ;
// ZipLocalEntry *createZipCDirEntry( const string &name ) ;
/** \anchor ZipInputStream_getnextentry_anchor
Opens the next entry in the zip archive and returns a const pointer to a
FileEntry object for the entry.
@return a const FileEntry * containing information about the (now) current
entry.
*/
ConstEntryPointer getNextEntry() ;
/** Destructor. */
virtual ~ZipInputStream() ;
private:
ifstream *ifs ;
ZipInputStreambuf *izf ;
/** Copy-constructor is private to prevent copying. */
ZipInputStream( const ZipInputStream &src ) ;
/** Copy-assignment operator is private to prevent copying. */
const ZipInputStream &operator= ( const ZipInputStream &src ) ;
};
} // namespace.
#endif
/** \file
Header file that defines ZipInputStream.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,89 +0,0 @@
#ifndef ZIPINPUTSTREAMBUF_H
#define ZIPINPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include <vector>
#include <HepRep-zlib.h>
#include "zipios++/fcoll.h"
#include "zipios++/inflateinputstreambuf.h"
#include "zipios++/ziphead.h"
namespace zipios {
/** ZipInputStreambuf is a zip input streambuf filter.
*/
class ZipInputStreambuf : public InflateInputStreambuf {
public:
/** ZipInputStreambuf constructor.
@param inbuf the streambuf to use for input.
@param s_pos a position to reset the inbuf to before reading. Specify
-1 to read from the current position.
@param del_inbuf if true is specified inbuf will be deleted, when
the ZipInputStreambuf is destructed.
*/
explicit ZipInputStreambuf( streambuf *inbuf, int s_pos = -1, bool del_inbuf = false ) ;
/** Closes the current entry, and positions the stream read pointer at
the beginning of the next entry (if there is one). */
void closeEntry() ;
/** Closes the streambuf. */
void close() ;
/** Opens the next entry in the zip archive and returns a const pointer to a
FileEntry object for the entry.
@return a const FileEntry * containing information about the (now) current
entry.
*/
ConstEntryPointer getNextEntry() ;
/** Destructor. */
virtual ~ZipInputStreambuf() ;
protected:
virtual int underflow() ;
private:
bool _open_entry ;
ZipLocalEntry _curr_entry ;
int _data_start ; // Don't forget entry header has a length too.
int _remain ; // For STORED entry only. the number of bytes that
// hasn't been put in the _outvec yet.
/** Copy-constructor is private to prevent copying. */
ZipInputStreambuf( const ZipInputStreambuf &src ) ;
/** Copy-assignment operator is private to prevent copying. */
const ZipInputStreambuf &operator= ( const ZipInputStreambuf &src ) ;
};
} // namespace
#endif
/** \file
Header file that defines ZipInputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,62 +0,0 @@
// MD: defined for our purposes
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if the std compliant iostream library should be used (if present) */
#define USE_STD_IOSTREAM 1
/* Define if zlib has zError */
#define HAVE_ZERROR 1
/* Define if you have the <unistd.h> header file. */
//#define HAVE_UNISTD_H 1
/* Name of package */
#define PACKAGE "zipios++"
/* Version number of package */
#define VERSION "0.1.5"
/* define if the compiler implements namespaces */
#define HAVE_NAMESPACES 1
/* define if the compiler supports Standard Template Library */
#define HAVE_STL 1
/* define if the compiler supports ISO C++ standard library */
#define HAVE_STD 1
/* define if the compiler has std compliant iostream library */
// MD defined for Geant4, Solaris and Linux 2.95.2 do not have this...
#if defined (WIN32) || __GNUC__ > 2
#define HAVE_STD_IOSTREAM 1
#endif
//#undef S_ISSOCK
//#define S_ISSOCK(mode) 0
#ifdef WIN32
#ifndef GNU_GCC
# ifdef _MSC_VER
// Disable class-browser warning about truncated template-names
# pragma warning( disable : 4786 )
# endif //_MSC_VER
// Needed for FilePath
# define S_ISREG(mode) (((mode) & _S_IFREG) == _S_IFREG)
# define S_ISDIR(mode) (((mode) & _S_IFDIR) == _S_IFDIR)
# define S_ISCHR(mode) (((mode) & _S_IFCHR) == _S_IFCHR)
# define S_ISBLK(mode) 0
# define S_ISSOCK(mode) 0
# define S_ISFIFO(mode) (((mode) & _S_IFIFO) == _S_IFIFO)
#endif
#endif
#include <cassert>
@@ -1,52 +0,0 @@
#ifndef ZIPIOS_COMMON_H
#define ZIPIOS_COMMON_H
#include "zipios++/zipios-config.h"
#include <vector>
namespace zipios {
using std::vector;
static const char separator = '/' ;
template< class Type >
void operator += ( vector< Type > &v1, const vector< Type > &v2 ) {
typename std::vector<Type>::const_iterator cit ;
for ( cit = v2.begin() ; cit != v2.end() ; ++cit )
v1.push_back( *cit ) ;
}
template< class T >
inline const T& min( const T& a, const T& b ) {
return b < a ? b : a ;
}
} // namespace
#endif
/** \file
Header file containing miscellaneous small functions.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,34 +0,0 @@
#ifndef ZIPIOS_DEFS_H
#define ZIPIOS_DEFS_H
namespace zipios {
typedef unsigned short uint16 ;
typedef unsigned long uint32 ;
} // namespace
#endif
/** \file
Header file that defines some simple data types.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,101 +0,0 @@
#ifndef ZIPOUTPUTSTREAM_H
#define ZIPOUTPUTSTREAM_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include "zipios++/ziphead.h"
#include "zipios++/zipoutputstreambuf.h"
namespace zipios {
/** \anchor ZipOutputStream_anchor
ZipOutputStream is an ostream that writes the output to a zip file. The
interface approximates the interface of the Java ZipOutputStream. */
class ZipOutputStream : public std::ostream {
public:
/** ZipOutputStream constructor.
@param os ostream to which the compressed zip archive is written.
@param pos position to reposition the ostream to before reading. */
explicit ZipOutputStream( std::ostream &os ) ;
/** ZipOutputStream constructor.
@filename filename to write the zip archive to. */
explicit ZipOutputStream( const std::string &filename ) ;
/** Closes the current entry updates its header with the relevant
size information and positions the stream write pointer for the
next entry header. Puts the stream in EOF state. Call
putNextEntry() to clear the EOF stream state flag. */
void closeEntry() ;
/** Calls finish and if the ZipOutputStream was created with a
filename as a parameter that file is closed as well. If the
ZipOutputStream was created with an ostream as its first
parameter nothing but the call to finish happens. */
void close() ;
/** Closes the current entry (if one is open), then writes the Zip
Central Directory Structure closing the ZipOutputStream. The
output stream that the zip archive is being written to is not
closed. */
void finish() ;
/** \anchor ZipOutputStream_putnextentry_anchor
Begins writing the next entry.
*/
void putNextEntry( const ZipCDirEntry &entry ) ;
/** \anchor ZipOutputStream_putnextentry2_anchor
Begins writing the next entry.
*/
void putNextEntry(const std::string& entryName);
/** Sets the global comment for the Zip archive. */
void setComment( const std::string& comment ) ;
/** Sets the compression level to be used for subsequent entries. */
void setLevel( int level ) ;
/** Sets the compression method to be used. only STORED and DEFLATED are
supported. */
void setMethod( StorageMethod method ) ;
/** Destructor. */
virtual ~ZipOutputStream() ;
private:
std::ofstream *ofs ;
ZipOutputStreambuf *ozf ;
};
} // namespace.
#endif
/** \file
Header file that defines ZipOutputStream.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,116 +0,0 @@
#ifndef ZIPOUTPUTSTREAMBUF_H
#define ZIPOUTPUTSTREAMBUF_H
#include "zipios++/zipios-config.h"
#include <vector>
#include <HepRep-zlib.h>
#include "zipios++/fcoll.h"
#include "zipios++/deflateoutputstreambuf.h"
#include "zipios++/ziphead.h"
namespace zipios {
/** ZipOutputStreambuf is a zip input streambuf filter. */
class ZipOutputStreambuf : public DeflateOutputStreambuf {
public:
enum CompressionLevels { NO_COMPRESSION = Z_NO_COMPRESSION,
BEST_SPEED = Z_BEST_SPEED,
BEST_COMPRESSION = Z_BEST_COMPRESSION,
DEFAULT_COMPRESSION = Z_DEFAULT_COMPRESSION } ;
/** ZipOutputStreambuf constructor. A newly constructed ZipOutputStreambuf
is not ready to accept data, putNextEntry() must be invoked first.
@param outbuf the streambuf to use for input.
@param del_outbuf if true is specified outbuf will be deleted, when
the ZipOutputStreambuf is destructed. */
explicit ZipOutputStreambuf( streambuf *outbuf, bool del_outbuf = false ) ;
/** Closes the current entry, and positions the stream read pointer at
the beginning of the next entry (if there is one). */
void closeEntry() ;
/** Calls finish. */
void close() ;
/** Closes the current entry (if one is open), then writes the Zip
Central Directory Structure closing the ZipOutputStream. The
output stream that the zip archive is being written to is not
closed. */
void finish() ;
/** Begins writing the next entry.
Opens the next entry in the zip archive and returns a const pointer to a
FileEntry object for the entry.
@return a const FileEntry * containing information about the (now) current
entry. */
void putNextEntry( const ZipCDirEntry &entry ) ;
/** Sets the global comment for the Zip archive. */
void setComment( const string &comment ) ;
/** Sets the compression level to be used for subsequent entries. */
void setLevel( int level ) ;
/** Sets the compression method to be used. only STORED and DEFLATED are
supported. */
void setMethod( StorageMethod method ) ;
/** Destructor. */
virtual ~ZipOutputStreambuf() ;
protected:
virtual int overflow( int c = EOF ) ;
virtual int sync() ;
void setEntryClosedState() ;
void updateEntryHeaderInfo() ;
// Should/could be moved to zipheadio.h ?!
static void writeCentralDirectory( const vector< ZipCDirEntry > &entries,
EndOfCentralDirectory eocd,
ostream &os ) ;
private:
string _zip_comment ;
vector< ZipCDirEntry > _entries ;
bool _open_entry ;
bool _open ;
StorageMethod _method ;
int _level ;
};
} // namespace
#endif
/** \file
Header file that defines ZipOutputStreambuf.
*/
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -1,329 +0,0 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2004 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id: HepRep-zconf.h,v 1.4 2004/11/22 19:08:58 duns Exp $ */
#ifndef _HEPREP_ZCONF_H
#define _HEPREP_ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
/* MD: changed z_ into heprep_z_ */
# define deflateInit_ heprep_z_deflateInit_
# define deflate heprep_z_deflate
# define deflateEnd heprep_z_deflateEnd
# define inflateInit_ heprep_z_inflateInit_
# define inflate heprep_z_inflate
# define inflateEnd heprep_z_inflateEnd
# define deflateInit2_ heprep_z_deflateInit2_
# define deflateSetDictionary heprep_z_deflateSetDictionary
# define deflateCopy heprep_z_deflateCopy
# define deflateReset heprep_z_deflateReset
# define deflateParams heprep_z_deflateParams
# define deflateBound heprep_z_deflateBound
# define deflatePrime heprep_z_deflatePrime
# define inflateInit2_ heprep_z_inflateInit2_
# define inflateSetDictionary heprep_z_inflateSetDictionary
# define inflateSync heprep_z_inflateSync
# define inflateSyncPoint heprep_z_inflateSyncPoint
# define inflateCopy heprep_z_inflateCopy
# define inflateReset heprep_z_inflateReset
# define inflateBack heprep_z_inflateBack
# define inflateBackEnd heprep_z_inflateBackEnd
# define compress heprep_z_compress
# define compress2 heprep_z_compress2
# define compressBound heprep_z_compressBound
# define uncompress heprep_z_uncompress
# define adler32 heprep_z_adler32
# define crc32 heprep_z_crc32
# define get_crc_table heprep_z_get_crc_table
# define zError heprep_z_zError
/* MD: added define for lonely symbol not renamed */
# define z_errmsg heprep_z_errmsg
# define Byte heprep_z_Byte
# define uInt heprep_z_uInt
# define uLong heprep_z_uLong
# define Bytef heprep_z_Bytef
# define charf heprep_z_charf
# define intf heprep_z_intf
# define uIntf heprep_z_uIntf
# define uLongf heprep_z_uLongf
# define voidpf heprep_z_voidpf
# define voidp heprep_z_voidp
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
# define OS2
#endif
#if defined(_WINDOWS) && !defined(WINDOWS)
# define WINDOWS
#endif
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
# define WIN32
#endif
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
# ifndef SYS16BIT
# define SYS16BIT
# endif
# endif
#endif
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#ifdef SYS16BIT
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
#ifdef __STDC_VERSION__
# ifndef STDC
# define STDC
# endif
# if __STDC_VERSION__ >= 199901L
# ifndef STDC99
# define STDC99
# endif
# endif
#endif
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
# define STDC
#endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
# define STDC
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
#endif
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
# define STDC
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const /* note: need a more gentle solution here */
# endif
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#ifdef SYS16BIT
# if defined(M_I86SM) || defined(M_I86MM)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
/* Turbo C small or medium model */
# define SMALL_MEDIUM
# ifdef __BORLANDC__
# define FAR _far
# else
# define FAR far
# endif
# endif
#endif
#if defined(WINDOWS) || defined(WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR CDECL
# endif
# endif
#endif
#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
# define ZEXPORT __declspec(dllexport)
# define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef FAR
# define FAR
#endif
#if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void const *voidpc;
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte const *voidpc;
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
# include <sys/types.h> /* for off_t */
# include <unistd.h> /* for SEEK_* and off_t */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if defined(__OS400__)
# define NO_vsnprintf
#endif
#if defined(__MVS__)
# define NO_vsnprintf
# ifdef FAR
# undef FAR
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
# pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND")
# pragma map(deflateBound,"DEBND")
# pragma map(inflateInit_,"ININ")
# pragma map(inflateInit2_,"ININ2")
# pragma map(inflateEnd,"INEND")
# pragma map(inflateSync,"INSY")
# pragma map(inflateSetDictionary,"INSEDI")
# pragma map(compressBound,"CMBND")
# pragma map(inflate_table,"INTABL")
# pragma map(inflate_fast,"INFA")
# pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* _HEPREP_ZCONF_H */
File diff suppressed because it is too large Load Diff
@@ -1,263 +0,0 @@
/* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-2003 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
/* @(#) $Id: HepRep-zutil.h,v 1.3 2004/11/22 19:08:58 duns Exp $ */
#ifndef _HEPREP_ZUTIL_H
#define _HEPREP_ZUTIL_H
#define ZLIB_INTERNAL
#include "HepRep-zlib.h"
#ifdef STDC
# include <stddef.h>
# include <string.h>
# include <stdlib.h>
#endif
#ifdef NO_ERRNO_H
extern int errno;
#else
# include <errno.h>
#endif
#ifndef local
# define local static
#endif
/* compile with -Dlocal if your debugger can't find static symbols */
typedef unsigned char uch;
typedef uch FAR uchf;
typedef unsigned short ush;
typedef ush FAR ushf;
typedef unsigned long ulg;
extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define ERR_RETURN(strm,err) \
return (strm->msg = (char*)ERR_MSG(err), (err))
/* To be used only when the state is known to be valid */
/* common constants */
#ifndef DEF_WBITS
# define DEF_WBITS MAX_WBITS
#endif
/* default windowBits for decompression. MAX_WBITS is for compression only */
#if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8
#else
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
/* default memLevel */
#define STORED_BLOCK 0
#define STATIC_TREES 1
#define DYN_TREES 2
/* The three kinds of block type */
#define MIN_MATCH 3
#define MAX_MATCH 258
/* The minimum and maximum match lengths */
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
/* target dependencies */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
# if defined(__TURBOC__) || defined(__BORLANDC__)
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
/* Allow compilation with ANSI keywords only enabled */
void _Cdecl farfree( void *block );
void *_Cdecl farmalloc( unsigned long nbytes );
# else
# include <alloc.h>
# endif
# else /* MSC or DJGPP */
# include <malloc.h>
# endif
#endif
#ifdef AMIGA
# define OS_CODE 0x01
#endif
#if defined(VAXC) || defined(VMS)
# define OS_CODE 0x02
# define F_OPEN(name, mode) \
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
#endif
#if defined(ATARI) || defined(atarist)
# define OS_CODE 0x05
#endif
#ifdef OS2
# define OS_CODE 0x06
#endif
#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fdopen */
# else
# ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */
# endif
# endif
#endif
#ifdef TOPS20
# define OS_CODE 0x0a
#endif
#ifdef WIN32
# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
# define OS_CODE 0x0b
# endif
#endif
#ifdef __50SERIES /* Prime/PRIMOS */
# define OS_CODE 0x0f
#endif
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600))
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED
typedef int ptrdiff_t;
# define _PTRDIFF_T_DEFINED
# endif
# else
# define fdopen(fd,type) _fdopen(fd,type)
# endif
#endif
/* common defaults */
#ifndef OS_CODE
# define OS_CODE 0x03 /* assume Unix */
#endif
#ifndef F_OPEN
# define F_OPEN(name, mode) fopen((name), (mode))
#endif
/* functions */
#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
# ifndef HAVE_VSNPRINTF
# define HAVE_VSNPRINTF
# endif
#endif
#if defined(__CYGWIN__)
# ifndef HAVE_VSNPRINTF
# define HAVE_VSNPRINTF
# endif
#endif
#ifndef HAVE_VSNPRINTF
# ifdef MSDOS
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
but for now we just assume it doesn't. */
# define NO_vsnprintf
# endif
# ifdef __TURBOC__
# define NO_vsnprintf
# endif
# ifdef WIN32
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
# define vsnprintf _vsnprintf
# endif
# endif
# ifdef __SASC
# define NO_vsnprintf
# endif
#endif
#ifdef VMS
# define NO_vsnprintf
#endif
#ifdef HAVE_STRERROR
# ifndef VMS
extern char *strerror OF((int));
# endif
# define zstrerror(errnum) strerror(errnum)
#else
# define zstrerror(errnum) ""
#endif
#if defined(pyr)
# define NO_MEMCPY
#endif
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
/* Use our own functions for small and medium model with MSC <= 5.0.
* You may have to use the same strategy for Borland C (untested).
* The __SC__ check is for Symantec.
*/
# define NO_MEMCPY
#endif
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
# define HAVE_MEMCPY
#endif
#ifdef HAVE_MEMCPY
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
# define zmemcpy _fmemcpy
# define zmemcmp _fmemcmp
# define zmemzero(dest, len) _fmemset(dest, 0, len)
# else
# define zmemcpy memcpy
# define zmemcmp memcmp
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
extern void zmemzero OF((Bytef* dest, uInt len));
#endif
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
extern int z_verbose;
extern void z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
#else
# define Assert(cond,msg)
# define Trace(x)
# define Tracev(x)
# define Tracevv(x)
# define Tracec(c,x)
# define Tracecv(c,x)
#endif
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
void zcfree OF((voidpf opaque, voidpf ptr));
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
#endif /* _HEPREP_ZUTIL_H */
@@ -1,141 +0,0 @@
Mark Donszelmann - 18/11/2004
=============================
Files renamed to .cc
Functions were modified to compile with C++ compiler, type-name rather than name { type, in:
adler32.cc, compress.cc, crc32.cc, deflate.cc, gzio.cc, infback.cc, inffast.cc, inflate.cc
inftrees.cc, trees.cc, uncompr.cc
In: deflate.cc and trees.cc all strings are catsed to (char*) to avoid warnings.
Files zconf.h zlib.h and zutil.h were prefix with HepRep- (HepRep)
to avoid clashes with the same files in /usr/include and /usr/local/include
on unix systems.
Further modifications marked with MD: in:
HepRep-zconf.h, HepRep-zlib.h, inflate.h, infback.cc, inffast.cc, inflate.cc
inftrees.cc, gzio.cc
=============================================================
ZLIB DATA COMPRESSION LIBRARY
zlib 1.2.1 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
and rfc1952.txt (gzip format). These documents are also available in other
formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
of the library is given in the file example.c which also tests that the library
is working correctly. Another example is given in the file minigzip.c. The
compression library itself is composed of all source files except example.c and
minigzip.c.
To compile all files and run the test program, follow the instructions given at
the top of Makefile. In short "make test; make install" should work for most
machines. For Unix: "./configure; make test; make install" For MSDOS, use one
of the special makefiles such as Makefile.msc. For VMS, use Make_vms.com or
descrip.mms.
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
<info@winimage.com> for the Windows DLL version. The zlib home page is
http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem,
please check this site to verify that you have the latest version of zlib;
otherwise get the latest version and check whether the problem still exists or
not.
PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking
for help.
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available in
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
The changes made in version 1.2.1 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory "contrib".
A Java implementation of zlib is available in the Java Development Kit
http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html
See the zlib home page http://www.zlib.org for details.
A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is in the
CPAN (Comprehensive Perl Archive Network) sites
http://www.cpan.org/modules/by-module/Compress/
A Python interface to zlib written by A.M. Kuchling <amk@magnet.com> is
available in Python 1.5 and later versions, see
http://www.python.org/doc/lib/module-zlib.html
A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> is
availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html
An experimental package to read and write files in .zip format, written on top
of zlib by Gilles Vollant <info@winimage.com>, is available in the
contrib/minizip directory of zlib.
Notes for some targets:
- For Windows DLL versions, please see win32/DLL_FAQ.txt
- For 64-bit Irix, deflate.c must be compiled without any optimization. With
-O, one libpng test fails. The test works in 32 bit mode (with the -n32
compiler flag). The compiler bug has been reported to SGI.
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
when compiled with cc.
- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
necessary to get gzprintf working correctly. This is done by configure.
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
other compilers. Use "make test" to check your compiler.
- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
- For PalmOs, see http://palmzlib.sourceforge.net/
- When building a shared, i.e. dynamic library on Mac OS X, the library must be
installed before testing (do "make install" before "make test"), since the
library location is specified in the library.
Acknowledgments:
The deflate format used by zlib was defined by Phil Katz. The deflate
and zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib;
they are too numerous to cite here.
Copyright notice:
(C) 1995-2003 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
If you use the zlib library in a product, we would appreciate *not*
receiving lengthy legal documents to sign. The sources are provided
for free but without warranty of any kind. The library has been
entirely written by Jean-loup Gailly and Mark Adler; it does not
include third-party code.
If you redistribute modified sources, we would appreciate that you include
in the file ChangeLog history information documenting your changes. Please
read the FAQ for more information on the distribution of modified source
versions.
@@ -1,441 +0,0 @@
/* crc32.h -- tables for rapid CRC calculation
* Generated automatically by crc32.c
*/
local const unsigned long FAR crc_table[TBLS][256] =
{
{
0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
0x2d02ef8dUL
#ifdef BYFOUR
},
{
0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
0x9324fd72UL
},
{
0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
0xbe9834edUL
},
{
0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
0xde0506f1UL
},
{
0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
0x8def022dUL
},
{
0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
0x72fd2493UL
},
{
0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
0xed3498beUL
},
{
0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
0xf10605deUL
#endif
}
};

Some files were not shown because too many files have changed in this diff Show More