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"
18using namespace Stroika::Foundation::Streams;
30 virtual _SharedPtrIRep Clone ()
const override
32 return Memory::MakeSharedPtr<Rep_> ();
34 virtual optional<filesystem::path> GetDefaultFileSuffix ()
const override
44#if USE_NOISY_TRACE_IN_THIS_MODULE_
48 optional<String> readingSection;
49 Section currentSection;
50 for (
String line : in.ReadLines ()) {
52 if (line.StartsWith (
"["sv) and line.EndsWith (
"]"sv)) {
53 if (readingSection.has_value ()) {
54 p.fNamedSections.Add (*readingSection, currentSection);
55 currentSection.fProperties.clear ();
57 readingSection = line.SubString (1, -1);
59 else if (line.StartsWith (
";"sv)) {
62 else if (line.Contains (
"="sv)) {
63 size_t i = *line.Find (
'=');
69 if (readingSection.has_value ()) {
70 currentSection.fProperties.Add (key, value);
73 p.fUnnamedSection.fProperties.Add (key, value);
80 if (readingSection.has_value ()) {
81 p.fNamedSections.Add (*readingSection, currentSection);
86Variant::INI::Reader::Reader ()
auto MakeSharedPtr(ARGS_TYPE &&... args) -> shared_ptr< T >
same as make_shared, but if type T has block allocation, then use block allocation for the 'shared pa...
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 ...