00001 /* 00002 * 00003 * Copyright (C) 1997-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: ofstd 00019 * 00020 * Author: Marco Eichelberg 00021 * 00022 * Purpose: 00023 * classes: OFFilenameCreator 00024 * 00025 * Last Update: $Author: meichel $ 00026 * Update Date: $Date: 2005/12/08 16:05:56 $ 00027 * CVS/RCS Revision: $Revision: 1.8 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef OFFNAME_H 00035 #define OFFNAME_H 00036 00037 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00038 #include "dcmtk/ofstd/oftypes.h" 00039 #include "dcmtk/ofstd/ofstring.h" 00040 00043 class OFFilenameCreator 00044 { 00045 public: 00047 OFFilenameCreator(); 00048 00050 OFFilenameCreator(const OFFilenameCreator& copy); 00051 00053 virtual ~OFFilenameCreator(); 00054 00056 OFFilenameCreator &operator=(const OFFilenameCreator& copy); 00057 00066 OFBool makeFilename(unsigned int seed, const char *dir, const char *prefix, const char *postfix, OFString &filename); 00067 00072 static unsigned int hashString(const char *str); 00073 00081 static int myrand_r(unsigned int *seed); 00082 00083 private: 00084 00086 unsigned long creation_time; 00087 00093 static void addLongToString(unsigned long l, OFString& s); 00094 }; 00095 00096 #endif 00097 00098 /* 00099 * $Log: offname.h,v $ 00100 * Revision 1.8 2005/12/08 16:05:56 meichel 00101 * Changed include path schema for all DCMTK header files 00102 * 00103 * Revision 1.7 2003/12/05 10:37:41 joergr 00104 * Removed leading underscore characters from preprocessor symbols (reserved 00105 * symbols). Updated copyright date where appropriate. 00106 * 00107 * Revision 1.6 2003/06/12 13:15:59 joergr 00108 * Fixed inconsistent API documentation reported by Doxygen. 00109 * 00110 * Revision 1.5 2001/06/01 15:51:34 meichel 00111 * Updated copyright header 00112 * 00113 * Revision 1.4 2000/10/10 12:01:04 meichel 00114 * Implemented thread safe random number generator, needed on systems 00115 * where threads but no Posix rand_r function are available. 00116 * 00117 * Revision 1.3 2000/03/08 16:36:01 meichel 00118 * Updated copyright header. 00119 * 00120 * Revision 1.2 1999/03/22 09:00:50 joergr 00121 * Added/Changed comments. 00122 * 00123 * Revision 1.1 1999/03/03 13:58:04 meichel 00124 * Implemented new class for automatically creating filenames. 00125 * 00126 * 00127 */ 00128