4#include "Stroika/Foundation/StroikaPreComp.h"
6#include "Stroika/Foundation/Characters/FloatConversion.h"
8#include "Stroika/Foundation/Characters/String2Int.h"
9#include "Stroika/Foundation/DataExchange/BadFormatException.h"
17using namespace Stroika::Foundation::Streams;
29 virtual _SharedPtrIRep Clone ()
const override
31 return make_shared<Rep_> ();
33 virtual optional<filesystem::path> GetDefaultFileSuffix ()
const override
43#if USE_NOISY_TRACE_IN_THIS_MODULE_
47 optional<String> readingSection;
48 Section currentSection;
49 for (
String line : in.ReadLines ()) {
51 if (line.StartsWith (
"["sv) and line.EndsWith (
"]"sv)) {
52 if (readingSection.has_value ()) {
53 p.fNamedSections.Add (*readingSection, currentSection);
54 currentSection.fProperties.clear ();
56 readingSection = line.SubString (1, -1);
58 else if (line.StartsWith (
";"sv)) {
61 else if (line.Contains (
"="sv)) {
62 size_t i = *line.Find (
'=');
68 if (readingSection.has_value ()) {
69 currentSection.fProperties.Add (key, value);
72 p.fUnnamedSection.fProperties.Add (key, value);
79 if (readingSection.has_value ()) {
80 p.fNamedSections.Add (*readingSection, currentSection);
85Variant::INI::Reader::Reader ()
86 : inherited{make_shared<Rep_> ()}
conditional_t< qStroika_Foundation_Memory_PreferBlockAllocation and andTrueCheck, BlockAllocationUseHelper< T >, Common::Empty > UseBlockAllocationIfAppropriate
Use this to enable block allocation for a particular class. Beware of subclassing.
Profile Convert(const VariantValue &v)
String is like std::u32string, except it is much easier to use, often much more space efficient,...
nonvirtual bool EndsWith(const Character &c, CompareOptions co=eWithCase) const
nonvirtual String SubString(SZ from) const
nonvirtual String Trim(bool(*shouldBeTrimmed)(Character)=Character::IsWhitespace) const
nonvirtual bool StartsWith(const Character &c, CompareOptions co=eWithCase) const
Simple variant-value (case variant union) object, with (variant) basic types analogous to a value in ...
Ptr New(const InputStream::Ptr< byte > &src, optional< AutomaticCodeCvtFlags > codeCvtFlags={}, optional< SeekableFlag > seekable={}, ReadAhead readAhead=eReadAheadAllowed)
Create an InputStream::Ptr<Character> from the arguments (usually binary source) - which can be used ...