1 /* 2 * Copyright (c) 2025 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 #ifndef CAMERA_XML_NODE_H 16 #define CAMERA_XML_NODE_H 17 18 #include <memory> 19 #include <mutex> 20 21 namespace OHOS { 22 namespace CameraStandard { 23 24 class CameraXmlNode { 25 public: 26 static std::shared_ptr<CameraXmlNode> Create(); 27 28 CameraXmlNode() = default; 29 virtual ~CameraXmlNode() = default; 30 31 virtual std::shared_ptr<CameraXmlNode> GetChildrenNode() = 0; 32 virtual std::shared_ptr<CameraXmlNode> GetCopyNode() = 0; 33 virtual int32_t Config(const char *fileName, const char *encoding, int32_t options) = 0; 34 virtual void MoveToNext() = 0; 35 virtual void MoveToChildren() = 0; 36 37 virtual bool IsNodeValid() = 0; 38 virtual bool HasProp(const char *propName) = 0; 39 virtual int32_t GetProp(const char *propName, std::string &result) = 0; 40 virtual int32_t GetContent(std::string &result) = 0; 41 virtual std::string GetName() = 0; 42 virtual bool CompareName(const char *propName) = 0; 43 virtual bool IsElementNode() = 0; 44 45 virtual void FreeDoc() = 0; 46 virtual void FreeProp(char *propName) = 0; 47 virtual void CleanUpParser() = 0; 48 }; 49 } // namespace CameraStandard 50 } // namespace OHOS 51 #endif // CAMERA_XML_NODE_H