00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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();
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 }
00081
00082 #endif