comparison Core/Toolbox.h @ 759:8cfc6119a5bd dicom-rt

integration mainline -> dicom-rt
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Apr 2014 16:04:55 +0200
parents b22312081388 203157cb4fde
children e57e08ed510f
comparison
equal deleted inserted replaced
605:b82292ba2083 759:8cfc6119a5bd
1 /** 1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store 2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2013 Medical Physics Department, CHU of Liege, 3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege,
4 * Belgium 4 * Belgium
5 * 5 *
6 * This program is free software: you can redistribute it and/or 6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as 7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, either version 3 of the 8 * published by the Free Software Foundation, either version 3 of the
48 48
49 namespace Toolbox 49 namespace Toolbox
50 { 50 {
51 void ServerBarrier(); 51 void ServerBarrier();
52 52
53 void ToUpperCase(std::string& s); 53 void ToUpperCase(std::string& s); // Inplace version
54 54
55 void ToLowerCase(std::string& s); 55 void ToLowerCase(std::string& s); // Inplace version
56
57 void ToUpperCase(std::string& result,
58 const std::string& source);
59
60 void ToLowerCase(std::string& result,
61 const std::string& source);
56 62
57 void ReadFile(std::string& content, 63 void ReadFile(std::string& content,
58 const std::string& path); 64 const std::string& path);
59 65
60 void WriteFile(const std::string& content, 66 void WriteFile(const std::string& content,
61 const std::string& path); 67 const std::string& path);
62
63 void Sleep(uint32_t seconds);
64 68
65 void USleep(uint64_t microSeconds); 69 void USleep(uint64_t microSeconds);
66 70
67 void RemoveFile(const std::string& path); 71 void RemoveFile(const std::string& path);
68 72
79 83
80 uint64_t GetFileSize(const std::string& path); 84 uint64_t GetFileSize(const std::string& path);
81 85
82 void ComputeMD5(std::string& result, 86 void ComputeMD5(std::string& result,
83 const std::string& data); 87 const std::string& data);
88
89 void ComputeMD5(std::string& result,
90 const void* data,
91 size_t length);
84 92
85 void ComputeSHA1(std::string& result, 93 void ComputeSHA1(std::string& result,
86 const std::string& data); 94 const std::string& data);
87 95
88 bool IsSHA1(const std::string& str); 96 bool IsSHA1(const std::string& str);
107 // In-place percent-decoding for URL 115 // In-place percent-decoding for URL
108 void UrlDecode(std::string& s); 116 void UrlDecode(std::string& s);
109 117
110 Endianness DetectEndianness(); 118 Endianness DetectEndianness();
111 119
112 void Split(std::vector<std::string>& result, 120 std::string WildcardToRegularExpression(const std::string& s);
113 const std::string& source, 121
114 char delimiter); 122 void TokenizeString(std::vector<std::string>& result,
123 const std::string& source,
124 char separator);
115 } 125 }
116 } 126 }