Mercurial > hg > orthanc-databases
annotate Framework/Common/Dictionary.h @ 186:6fe74f9a516e
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 16 Dec 2020 15:05:19 +0100 |
parents | 4cd7e45b671e |
children | 3236894320d6 |
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 | |
140
4cd7e45b671e
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
67
diff
changeset
|
5 * Copyright (C) 2017-2020 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: | |
39 ~Dictionary(); | |
40 | |
41 bool HasKey(const std::string& key) const; | |
42 | |
43 void Remove(const std::string& key); | |
44 | |
45 void SetValue(const std::string& key, | |
46 IValue* value); // Takes ownership | |
47 | |
48 void SetUtf8Value(const std::string& key, | |
49 const std::string& utf8); | |
50 | |
51 void SetBinaryValue(const std::string& key, | |
52 const std::string& binary); | |
53 | |
14
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
54 void SetFileValue(const std::string& key, |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
55 const std::string& file); |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
56 |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
57 void SetFileValue(const std::string& key, |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
58 const void* content, |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
59 size_t size); |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4
diff
changeset
|
60 |
0 | 61 void SetIntegerValue(const std::string& key, |
62 int64_t value); | |
63 | |
64 void SetNullValue(const std::string& key); | |
65 | |
66 const IValue& GetValue(const std::string& key) const; | |
67 }; | |
68 } |