Debian Codegraph @

modules/lsp-runtime-lib/src/main/i18n/IDictionary.cpp

raw
1 /*
2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2020 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 26 февр. 2020 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #include <lsp-plug.in/i18n/IDictionary.h>
23
24 namespace lsp
25 {
26 namespace i18n
27 {
28 IDictionary::IDictionary()
29 {
30 }
31
32 IDictionary::~IDictionary()
33 {
34 }
35
36 status_t IDictionary::init(const char *path)
37 {
38 if (path == NULL)
39 return STATUS_BAD_ARGUMENTS;
40 LSPString xpath;
41 if (!xpath.set_utf8(path))
42 return STATUS_NO_MEM;
43 return init(&xpath);
44 }
45
46 status_t IDictionary::init(const io::Path *path)
47 {
48 if (path == NULL)
49 return STATUS_BAD_ARGUMENTS;
50 return init(path->as_string());
51 }
52
53 status_t IDictionary::init(const LSPString *path)
54 {
55 return STATUS_OK;
56 }
57
58 status_t IDictionary::lookup(const char *key, LSPString *value)
59 {
60 LSPString path;
61 if (!path.set_utf8(key))
62 return STATUS_NO_MEM;
63 return lookup(&path, value);
64 }
65
66 status_t IDictionary::lookup(const LSPString *key, LSPString *value)
67 {
68 return STATUS_NOT_FOUND;
69 }
70
71 status_t IDictionary::lookup(const char *key, IDictionary **value)
72 {
73 LSPString path;
74 if (!path.set_utf8(key))
75 return STATUS_NO_MEM;
76 return lookup(&path, value);
77 }
78
79 status_t IDictionary::lookup(const LSPString *key, IDictionary **value)
80 {
81 return STATUS_NOT_FOUND;
82 }
83
84 status_t IDictionary::get_value(size_t index, LSPString *key, LSPString *value)
85 {
86 return STATUS_NOT_FOUND;
87 }
88
89 status_t IDictionary::get_child(size_t index, LSPString *key, IDictionary **dict)
90 {
91 return STATUS_NOT_FOUND;
92 }
93
94 size_t IDictionary::size()
95 {
96 return 0;
97 }
98 }
99
100 } /* namespace lsp */