Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
XmlProperty.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* XmlProperty.h (C) 2000-2025 */
9/* */
10/* Properties linked to an XML node. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_XMLPROPERTY_H
13#define ARCANE_CORE_XMLPROPERTY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IProperty.h"
18#include "arcane/core/XmlNode.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * \brief Interface of a property value.
31 */
32class XmlPropertyValue
33: public IPropertyValue
34{
35 public:
36
37 XmlPropertyValue(const XmlNode& node, IPropertyType* type,
38 IPropertyTypeInstance* type_instance);
39 XmlPropertyValue();
40
41 public:
42
43 void valueToString(String& str) const override;
44 void nameToString(String& str) const override;
45 void setValueFromString(const String& str) override;
46 bool isDefaultValue() const override;
47 bool isOriginalValue() const override;
48 void originalValueToString(String& str) const override;
49 bool canBeEdited() const override;
50 IPropertyType* type() override;
52
53 public:
54
55 XmlNode& node();
56 void setNode(const XmlNode& node);
57 void setType(IPropertyType* type);
58 void setTypeInstance(IPropertyTypeInstance* type_instance);
59
60 private:
61
62 XmlNode m_node;
63 IPropertyType* m_type = nullptr;
64 IPropertyTypeInstance* m_type_instance = nullptr;
65};
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70} // namespace Arcane
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75#endif
Node of a DOM tree.
Definition XmlNode.h:51
bool canBeEdited() const override
Returns whether the value can be edited.
void nameToString(String &str) const override
Stores the property name in str.
bool isDefaultValue() const override
Returns whether the current value is the default value.
void originalValueToString(String &str) const override
Stores the original property value in str.
void setValueFromString(const String &str) override
Positions the new property value at str.
bool isOriginalValue() const override
Returns whether the current value is the original value.
IPropertyTypeInstance * typeInstance() override
Returns the instance associated with this value.
IPropertyType * type() override
Returns the type of this property.
void valueToString(String &str) const override
Stores the property value in str.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --