Stroika Library
3.0d16
Help-Home
Loading...
Searching...
No Matches
SerializationConfiguration.h
1
/*
2
* Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3
*/
4
#ifndef _Stroika_Foundation_DataExchange_XML_SerializationConfiguration_h_
5
#define _Stroika_Foundation_DataExchange_XML_SerializationConfiguration_h_ 1
6
7
#include "Stroika/Foundation/StroikaPreComp.h"
8
9
#include <optional>
10
11
#include "
Stroika/Foundation/Characters/String.h
"
12
#include "Stroika/Foundation/Common/Common.h"
13
#include "
Stroika/Foundation/DataExchange/XML/Common.h
"
14
15
/*
16
* TODO:
17
* @todo Add support for namespaces
18
*
19
* @todo Add support for Schema validation
20
* and optionally more stuff � for how to map between variant structure and schema.
21
* Maybe have virtual API to make certain decisions?
22
* Will need experience/experimentation to get right
23
*/
24
25
namespace
Stroika::Foundation::DataExchange::XML {
26
27
using
Characters::String;
28
29
/**
30
* @see XML::Reader, and @see XML::Writer
31
*/
32
class
SerializationConfiguration
{
33
public
:
34
SerializationConfiguration
();
35
36
public
:
37
// NOTE - defaults to "Document"
38
// if empty - then Write requiers
39
// Require (v.GetType () == VariantValue::eMap);
40
//
41
// If provided - must be a valid xml element name (ncname?)
42
nonvirtual optional<String> GetDocumentElementName ()
const
;
43
nonvirtual
void
SetDocumentElementName (
const
optional<String>& n);
44
45
public
:
46
// NOTE - defaults to "Array"
47
//
48
// If provided - must be a valid xml element name (ncname?)
49
//
50
// DOCUMENT CONSEQUENCES OF MISSING (cannot deseriualize without knowing diff
51
// between a single element and an array. Need some way to tell. Perhaps in the
52
// the future this can be better handled infering data from the schema.
53
// but for now - with the current implementation - this is needed.
54
nonvirtual optional<String> GetArrayElementName ()
const
;
55
nonvirtual
void
SetArrayElementName (
const
optional<String>& n);
56
57
private
:
58
String
fDocumentElementName_;
// internally empty string for missing
59
String
fArrayElementName_;
// internally empty string for missing
60
};
61
62
}
63
64
/*
65
********************************************************************************
66
***************************** Implementation Details ***************************
67
********************************************************************************
68
*/
69
#include "SerializationConfiguration.inl"
70
71
#endif
/*_Stroika_Foundation_DataExchange_XML_SerializationConfiguration_h_*/
Common.h
String.h
Stroika::Foundation::Characters::String
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition
String.h:201
Stroika::Foundation::DataExchange::XML::SerializationConfiguration
Definition
SerializationConfiguration.h:32
Library
Sources
Stroika
Foundation
DataExchange
XML
SerializationConfiguration.h
Generated by
1.9.8