Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

gdcmUtil.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmUtil.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/02/02 15:07:41 $
00007   Version:   $Revision: 1.53 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #ifndef GDCMUTIL_H
00020 #define GDCMUTIL_H
00021 
00022 #include "gdcmCommon.h"
00023 #include <vector>
00024 #include <string>
00025 
00026 namespace gdcm 
00027 {
00034 //-----------------------------------------------------------------------------
00035 
00036 class GDCM_EXPORT Util
00037 {
00038 public:
00039    static std::string Format(const char *format, ...);
00040    static void        Tokenize (const std::string &str,
00041                                 std::vector<std::string> &tokens,
00042                                 const std::string &delimiters = " ");
00043    static int         CountSubstring (const std::string &str,
00044                                       const std::string &subStr);       
00045 
00046    static std::string CreateCleanString(std::string const &s);
00047    static std::string NormalizePath(std::string const &name);
00048    static std::string GetPath(std::string const &fullName);
00049    static std::string GetName(std::string const &fullName);
00050    static std::string GetCurrentDate();
00051    static std::string GetCurrentTime();
00052    static std::string GetCurrentDateTime();
00053    static unsigned int GetCurrentThreadID();
00054    static unsigned int GetCurrentProcessID();
00055    static bool         IsCurrentProcessorBigEndian();
00056 
00057    static std::string DicomString(const char *s, size_t l);
00058    static std::string DicomString(const char *s);
00059    static bool        DicomStringEqual(const std::string &s1, const char *s2);
00060 
00061    static std::string GetMACAddress();
00062 
00063    static std::string CreateUniqueUID(const std::string &root = "");
00064    static void SetRootUID(const std::string &root = "");
00065    static const std::string &GetRootUID();
00066 
00067 private:
00068    static std::string GetIPAddress(); //Do not expose this method
00069 
00070    static std::string RootUID;
00071    static const std::string GDCM_UID;
00072 };
00073 
00074 template <class T> 
00075 GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const T &val);
00076 GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const uint16_t &val);
00077 GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const uint32_t &val);
00078 GDCM_EXPORT std::ostream &binary_write(std::ostream &os, const char *val);
00079 GDCM_EXPORT std::ostream &binary_write(std::ostream &os, std::string const &val);
00080 } // end namespace gdcm
00081 //-----------------------------------------------------------------------------
00082 #endif

Generated on Thu Feb 10 22:18:00 2005 for gdcm by doxygen 1.3.6