Mercurial > hg > orthanc-databases
annotate Framework/Common/Dictionary.h @ 336:c0c12b3974b2
fix URLs to the old repositories
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 11 Aug 2021 11:48:52 +0200 |
parents | 87f0e29a1dc1 |
children | 16aac0287485 |
rev | line source |
---|---|
0 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
193
3236894320d6
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
140
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "IValue.h" | |
25 | |
26 #include <map> | |
4 | 27 #include <stdint.h> |
0 | 28 |
29 namespace OrthancDatabases | |
30 { | |
31 class Dictionary : public boost::noncopyable | |
32 { | |
33 private: | |
34 typedef std::map<std::string, IValue*> Values; | |
35 | |
36 Values values_; | |
37 | |
38 public: | |
305
87f0e29a1dc1
added Dictionary::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
39 ~Dictionary() |
87f0e29a1dc1
added Dictionary::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
40 { |
87f0e29a1dc1
added Dictionary::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
41 Clear(); |
87f0e29a1dc1
added Dictionary::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
42 } |
87f0e29a1dc1
added Dictionary::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
43 |
87f0e29a1dc1
added Dictionary::Clear()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
44 void Clear(); |
0 | 45 |
46 bool HasKey(const std::string& key) const; | |
47 | |
48 void Remove(const std::string& key); | |
49 | |
50 void SetValue(const std::string& key, | |
51 IValue* value); // Takes ownership | |
52 | |
53 void SetUtf8Value(const std::string& key, | |
54 const std::string& utf8); | |
55 | |
56 void SetBinaryValue(const std::string& key, | |
57 const std::string& binary); | |
58 | |
14
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
59 void SetFileValue(const std::string& key, |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
60 const std::string& file); |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
61 |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
62 void SetFileValue(const std::string& key, |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
63 const void* content, |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
64 size_t size); |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
65 |
0 | 66 void SetIntegerValue(const std::string& key, |
67 int64_t value); | |
68 | |
69 void SetNullValue(const std::string& key); | |
70 | |
71 const IValue& GetValue(const std::string& key) const; | |
72 }; | |
73 } |