1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef LOADER_RENDER_NODE_GRAPH_LOADER_H
17 #define LOADER_RENDER_NODE_GRAPH_LOADER_H
18 
19 #include <base/containers/string_view.h>
20 #include <base/containers/vector.h>
21 #include <core/namespace.h>
22 #include <render/namespace.h>
23 #include <render/nodecontext/intf_render_node_graph_manager.h>
24 
25 CORE_BEGIN_NAMESPACE()
26 class IFileManager;
27 CORE_END_NAMESPACE()
RENDER_BEGIN_NAMESPACE()28 RENDER_BEGIN_NAMESPACE()
29 class RenderNodeGraphLoader final : public IRenderNodeGraphLoader {
30 public:
31     explicit RenderNodeGraphLoader(CORE_NS::IFileManager&);
32     ~RenderNodeGraphLoader() override = default;
33 
34     LoadResult Load(const BASE_NS::string_view uri) override;
35     LoadResult LoadString(const BASE_NS::string_view jsonString) override;
36 
37 private:
38     LoadResult LoadString(const BASE_NS::string_view uri, const BASE_NS::string_view jsonString);
39     CORE_NS::IFileManager& fileManager_;
40 };
41 RENDER_END_NAMESPACE()
42 
43 #endif // LOADER_RENDER_NODE_GRAPH_LOADER_H
44