From 82a72bf0181dbb11c66f3f1ab1d6affb8e64a608 Mon Sep 17 00:00:00 2001 From: Danilo Borges Santos Date: Wed, 20 Nov 2024 14:48:40 -0300 Subject: [PATCH] =?UTF-8?q?Coment=C3=A1rios=20em=20ContentSerializer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/pipeline/pipeline.hpp | 2 +- includes/xna/content/serializer.hpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/pipeline/pipeline.hpp b/includes/pipeline/pipeline.hpp index 0a129ac..8e60776 100644 --- a/includes/pipeline/pipeline.hpp +++ b/includes/pipeline/pipeline.hpp @@ -134,7 +134,7 @@ namespace xna { ContentItem() { opaqueData = std::make_shared(); } - + //Gets or sets the name of the content item. std::string Name() const { return name; } //Gets or sets the identity of the content item. diff --git a/includes/xna/content/serializer.hpp b/includes/xna/content/serializer.hpp index 56538b0..2bfafc2 100644 --- a/includes/xna/content/serializer.hpp +++ b/includes/xna/content/serializer.hpp @@ -4,12 +4,19 @@ #include namespace xna { + //A custom Attribute that marks a field or property to control how it is serialized or to indicate that protected or private data should be included in serialization. struct ContentSerializerAttribute { + //Gets or sets the XML element name (default=name of the managed type member). std::string ElementName; + //Gets or sets the XML element name for each item in a collection (default = "Item"). std::string CollectionItemName; + //Gets or sets a value idicating whether to write member contents directly into the current XML context rather than wrapping the member in a new XML element (default=false). bool FlatternContent{ false }; + //Indicates whether to write this element if the member is null and skip past it if not found when deserializing XML (default=false). bool Optional{ false }; + //Get or set a value indicating whether this member can have a null value (default=true). bool AllowNull{ true }; + //Indicates whether this member is referenced from multiple parents and should be serialized as a unique ID reference (default=false). bool SharedResource{ false }; }; }