OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::INI Class Reference

INI 形式のデータの読み書き More...

#include <INI.hpp>

Public Types

using Section = String
 
using SectionView = StringView
 
using Name = String
 
using NameView = StringView
 
using Section_Dot_Name = String
 
using Section_Dot_NameView = StringView
 
using Value = String
 
using SectionIndex = size_t
 
using KeyIndex = size_t
 

Public Member Functions

 INI ()
 
 INI (FilePathView path, const Optional< TextEncoding > &encoding=unspecified)
 
template<class Reader , std::enable_if_t< std::is_base_of_v< IReader, Reader > &&!std::is_lvalue_reference_v< Reader >> * = nullptr>
 INI (Reader &&reader, const Optional< TextEncoding > &encoding=unspecified)
 
 INI (std::unique_ptr< IReader > &&reader, const Optional< TextEncoding > &encoding=unspecified)
 
bool load (FilePathView path, const Optional< TextEncoding > &encoding=unspecified)
 
template<class Reader , std::enable_if_t< std::is_base_of_v< IReader, Reader > &&!std::is_lvalue_reference_v< Reader >> * = nullptr>
bool load (Reader &&reader, const Optional< TextEncoding > &encoding=unspecified)
 
bool load (std::unique_ptr< IReader > &&reader, const Optional< TextEncoding > &encoding=unspecified)
 
void clear ()
 
bool isEmpty () const noexcept
 
 operator bool () const noexcept
 
const Array< INISection > & sections () const noexcept
 
bool hasSection (SectionView section) const
 
const INISectiongetSection (SectionView section) const
 
bool hasValue (SectionView section, NameView name) const
 
const StringgetValue (SectionView section, NameView name) const
 
bool hasGlobalValue (NameView name) const
 
const StringgetGlobalValue (NameView name) const
 
const Valueoperator[] (Section_Dot_NameView section_dot_name) const
 
INIValueWrapper operator[] (Section_Dot_NameView section_dot_name)
 
template<class Type >
Type get (SectionView section, NameView name) const
 
template<class Type >
Type get (Section_Dot_NameView section_dot_name) const
 
template<class Type , class U >
Type getOr (SectionView section, NameView name, U &&defaultValue) const
 
template<class Type , class U >
Type getOr (Section_Dot_NameView section_dot_name, U &&defaultValue) const
 
template<class Type >
Optional< Type > getOpt (SectionView section, NameView name) const
 
template<class Type >
Optional< Type > getOpt (Section_Dot_NameView section_dot_name) const
 
void addSection (SectionView section)
 
void removeSection (SectionView section)
 
void write (SectionView section, NameView name, const Value &value)
 
template<class Type >
void write (SectionView section, NameView name, const Type &value)
 
void writeGlobal (NameView name, const Value &value)
 
template<class Type >
void writeGlobal (NameView name, const Type &value)
 
bool save (FilePathView path) const
 

Detailed Description

INI 形式のデータの読み書き

Member Typedef Documentation

◆ KeyIndex

using s3d::INI::KeyIndex = size_t

◆ Name

◆ NameView

◆ Section

◆ Section_Dot_Name

◆ Section_Dot_NameView

◆ SectionIndex

using s3d::INI::SectionIndex = size_t

◆ SectionView

◆ Value

Constructor & Destructor Documentation

◆ INI() [1/4]

s3d::INI::INI ( )

◆ INI() [2/4]

s3d::INI::INI ( FilePathView  path,
const Optional< TextEncoding > &  encoding = unspecified 
)
explicit

◆ INI() [3/4]

template<class Reader , std::enable_if_t< std::is_base_of_v< IReader, Reader > &&!std::is_lvalue_reference_v< Reader >> * = nullptr>
s3d::INI::INI ( Reader &&  reader,
const Optional< TextEncoding > &  encoding = unspecified 
)
explicit

◆ INI() [4/4]

s3d::INI::INI ( std::unique_ptr< IReader > &&  reader,
const Optional< TextEncoding > &  encoding = unspecified 
)
explicit

Member Function Documentation

◆ addSection()

void s3d::INI::addSection ( SectionView  section)

◆ clear()

void s3d::INI::clear ( )

◆ get() [1/2]

template<class Type >
Type s3d::INI::get ( Section_Dot_NameView  section_dot_name) const

◆ get() [2/2]

template<class Type >
Type s3d::INI::get ( SectionView  section,
NameView  name 
) const

◆ getGlobalValue()

const String& s3d::INI::getGlobalValue ( NameView  name) const

◆ getOpt() [1/2]

template<class Type >
Optional<Type> s3d::INI::getOpt ( Section_Dot_NameView  section_dot_name) const

◆ getOpt() [2/2]

template<class Type >
Optional<Type> s3d::INI::getOpt ( SectionView  section,
NameView  name 
) const

◆ getOr() [1/2]

template<class Type , class U >
Type s3d::INI::getOr ( Section_Dot_NameView  section_dot_name,
U &&  defaultValue 
) const

◆ getOr() [2/2]

template<class Type , class U >
Type s3d::INI::getOr ( SectionView  section,
NameView  name,
U &&  defaultValue 
) const

◆ getSection()

const INISection& s3d::INI::getSection ( SectionView  section) const

◆ getValue()

const String& s3d::INI::getValue ( SectionView  section,
NameView  name 
) const

◆ hasGlobalValue()

bool s3d::INI::hasGlobalValue ( NameView  name) const

◆ hasSection()

bool s3d::INI::hasSection ( SectionView  section) const

◆ hasValue()

bool s3d::INI::hasValue ( SectionView  section,
NameView  name 
) const

◆ isEmpty()

bool s3d::INI::isEmpty ( ) const
noexcept

◆ load() [1/3]

bool s3d::INI::load ( FilePathView  path,
const Optional< TextEncoding > &  encoding = unspecified 
)

◆ load() [2/3]

template<class Reader , std::enable_if_t< std::is_base_of_v< IReader, Reader > &&!std::is_lvalue_reference_v< Reader >> * = nullptr>
bool s3d::INI::load ( Reader &&  reader,
const Optional< TextEncoding > &  encoding = unspecified 
)

◆ load() [3/3]

bool s3d::INI::load ( std::unique_ptr< IReader > &&  reader,
const Optional< TextEncoding > &  encoding = unspecified 
)

◆ operator bool()

s3d::INI::operator bool ( ) const
explicitnoexcept

◆ operator[]() [1/2]

INIValueWrapper s3d::INI::operator[] ( Section_Dot_NameView  section_dot_name)

◆ operator[]() [2/2]

const Value& s3d::INI::operator[] ( Section_Dot_NameView  section_dot_name) const

◆ removeSection()

void s3d::INI::removeSection ( SectionView  section)

◆ save()

bool s3d::INI::save ( FilePathView  path) const

◆ sections()

const Array<INISection>& s3d::INI::sections ( ) const
noexcept

◆ write() [1/2]

template<class Type >
void s3d::INI::write ( SectionView  section,
NameView  name,
const Type &  value 
)

◆ write() [2/2]

void s3d::INI::write ( SectionView  section,
NameView  name,
const Value value 
)

◆ writeGlobal() [1/2]

template<class Type >
void s3d::INI::writeGlobal ( NameView  name,
const Type &  value 
)

◆ writeGlobal() [2/2]

void s3d::INI::writeGlobal ( NameView  name,
const Value value 
)

The documentation for this class was generated from the following file: