annotate Core/Uuid.h @ 121:a7e98bbeaf48 Orthanc-0.2.2

close
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 Apr 2013 12:54:48 +0200
parents 9eb40cad7935
children fe180eae201d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
59
c996319e90bc renaming in Core
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 50
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege,
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Belgium
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful, but
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * General Public License for more details.
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 *
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 **/
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 #pragma once
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include <string>
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 /**
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * GUID vs. UUID
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * The simple answer is: no difference, they are the same thing. Treat
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * them as a 16 byte (128 bits) value that is used as a unique
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * value. In Microsoft-speak they are called GUIDs, but call them
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * UUIDs when not using Microsoft-speak.
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 * http://stackoverflow.com/questions/246930/is-there-any-difference-between-a-guid-and-a-uuid
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 **/
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
59
c996319e90bc renaming in Core
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 50
diff changeset
34 namespace Orthanc
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 namespace Toolbox
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 std::string GenerateUuid();
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 bool IsUuid(const std::string& str);
82
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
41
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
42 class TemporaryFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
43 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
44 private:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
45 std::string path_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
46
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
47 public:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
48 TemporaryFile();
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
49
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
50 ~TemporaryFile();
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
51
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
52 const std::string& GetPath() const
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
53 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
54 return path_;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
55 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 59
diff changeset
56 };
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 }