Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Profile.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_DataExchange_INI_Profile_h_
5#define _Stroika_Foundation_DataExchange_INI_Profile_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
10#include "Stroika/Foundation/Common/Common.h"
11#include "Stroika/Foundation/Containers/Mapping.h"
13
14/**
15 * \file
16 */
17
18namespace Stroika::Foundation::DataExchange::Variant::INI {
19
20 using Containers::Mapping;
21
22 /**
23 * Each 'section' of an INI file consists of name/value pairs.
24 */
25 struct Section {
26 Mapping<String, String> fProperties;
27
28 bool operator== (const Section& rhs) const = default;
29
30 /**
31 * @see Characters::ToString ();
32 */
33 nonvirtual String ToString () const;
34 };
35
36 /**
37 * An INI file is a series of sections - one of which maybe unnamed, and the remaining are named.
38 */
39 struct Profile {
40 Section fUnnamedSection;
41 Mapping<String, Section> fNamedSections;
42
43 bool operator== (const Profile& rhs) const = default;
44
45 /**
46 * @see Characters::ToString ();
47 */
48 nonvirtual String ToString () const;
49 };
50
51 /**
52 * Map back and forth between Profile object, and structured VariantValue. If the VariantValue is not
53 * in the format of a legal Profile, this function (arg VariantValue) will throw.
54 */
55 Profile Convert (const VariantValue& v);
56 VariantValue Convert (const Profile& p);
57
58}
59
60/*
61 ********************************************************************************
62 ***************************** Implementation Details ***************************
63 ********************************************************************************
64 */
65#include "Profile.inl"
66
67#endif /*_Stroika_Foundation_DataExchange_INI_Profile_h_*/
Profile Convert(const VariantValue &v)
Definition Profile.cpp:50
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201
Simple variant-value (case variant union) object, with (variant) basic types analogous to a value in ...