NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
ini_section类 参考final

INI节类 更多...

#include <ini_value.hpp>

类 ini_section 继承关系图:
[图例]

Public 成员函数

 ini_section (string name)
 构造函数
 ini_section (ini_section &&other) noexcept=default
 移动构造函数
ini_sectionoperator= (ini_section &&other) noexcept=default
 移动赋值运算符
types type () const noexcept override
 获取类型
const ini_sectionas_section () const noexcept override
 转换为节指针
const stringget_name () const noexcept
 获取节名称
void set_name (string name) noexcept
 设置节名称
void add_property (const string &key, unique_ptr< ini_property > property)
 添加属性
void set_property (const string &key, string value)
 设置属性
const ini_propertyget_property (const string &key) const
 获取常量属性指针
ini_propertyget_property (const string &key)
 获取属性指针
bool has_property (const string &key) const
 检查属性是否存在
const unordered_map< string, unique_ptr< ini_property > > & get_properties () const noexcept
 获取所有属性的常量引用
string get_string (const string &key, const string &default_value="") const
 获取字符串值
int get_int (const string &key, int default_value=0) const
 获取整数值
double get_double (const string &key, double default_value=0.0) const
 获取双精度浮点值
bool get_bool (const string &key, bool default_value=false) const
 获取布尔值
Public 成员函数 继承自 ini_value
virtual ~ini_value ()=default
 虚析构函数
virtual const ini_propertyas_property () const noexcept
 转换为属性指针
bool is_section () const noexcept
 判断是否为节类型
bool is_property () const noexcept
 判断是否为属性类型
string to_string () const
 转换为字符串
string to_document () const
 转换为文档字符串
Public 成员函数 继承自 istringify< ini_value >
constexpr string to_string () const
 转换为字符串

额外继承的成员函数

Public 类型 继承自 ini_value
enum  types { Section , Property }
 INI值类型枚举 更多...

详细描述

INI节类

表示INI配置文件中的一个节(section),包含多个属性。 节可以有名(如[database])或无名(全局节)。

在文件 ini_value.hpp196 行定义.

构造及析构函数说明

◆ ini_section() [1/2]

ini_section::ini_section ( string name)
inlineexplicit

构造函数

参数
name节名称,默认为空(全局节)

在文件 ini_value.hpp208 行定义.

引用了 move() , 以及 name().

◆ ini_section() [2/2]

ini_section::ini_section ( ini_section && other)
defaultnoexcept

移动构造函数

参数
other源节对象

成员函数说明

◆ add_property()

void ini_section::add_property ( const string & key,
unique_ptr< ini_property > property )
inline

添加属性

参数
key属性键名
property属性智能指针

在文件 ini_value.hpp256 行定义.

引用了 move().

◆ as_section()

const ini_section * ini_section::as_section ( ) const
inlinenodiscardoverridevirtualnoexcept

转换为节指针

返回
返回自身指针

重载 ini_value .

在文件 ini_value.hpp237 行定义.

◆ get_bool()

bool ini_section::get_bool ( const string & key,
bool default_value = false ) const
inlinenodiscard

获取布尔值

参数
key属性键名
default_value默认值
返回
属性的布尔值

在文件 ini_value.hpp347 行定义.

引用了 ini_property::get_bool() , 以及 get_property().

被这些函数引用 ini_document::get_bool().

◆ get_double()

double ini_section::get_double ( const string & key,
double default_value = 0.0 ) const
inlinenodiscard

获取双精度浮点值

参数
key属性键名
default_value默认值
返回
属性的双精度浮点值

在文件 ini_value.hpp336 行定义.

引用了 ini_property::get_double() , 以及 get_property().

被这些函数引用 ini_document::get_double().

◆ get_int()

int ini_section::get_int ( const string & key,
int default_value = 0 ) const
inlinenodiscard

获取整数值

参数
key属性键名
default_value默认值
返回
属性的整数值

在文件 ini_value.hpp325 行定义.

引用了 ini_property::get_int() , 以及 get_property().

被这些函数引用 ini_document::get_int().

◆ get_name()

const string & ini_section::get_name ( ) const
inlinenodiscardnoexcept

获取节名称

返回
节名称的常量引用

在文件 ini_value.hpp243 行定义.

◆ get_properties()

const unordered_map< string, unique_ptr< ini_property > > & ini_section::get_properties ( ) const
inlinenodiscardnoexcept

获取所有属性的常量引用

返回
属性映射表的常量引用

在文件 ini_value.hpp304 行定义.

◆ get_property() [1/2]

ini_property * ini_section::get_property ( const string & key)
inlinenodiscard

获取属性指针

参数
key属性键名
返回
属性的指针,不存在返回nullptr

在文件 ini_value.hpp285 行定义.

◆ get_property() [2/2]

const ini_property * ini_section::get_property ( const string & key) const
inlinenodiscard

获取常量属性指针

参数
key属性键名
返回
属性的常量指针,不存在返回nullptr

在文件 ini_value.hpp272 行定义.

被这些函数引用 get_bool(), get_double(), get_int() , 以及 get_string().

◆ get_string()

string ini_section::get_string ( const string & key,
const string & default_value = "" ) const
inlinenodiscard

获取字符串值

参数
key属性键名
default_value默认值
返回
属性的字符串值

在文件 ini_value.hpp314 行定义.

引用了 get_property() , 以及 ini_property::get_value().

被这些函数引用 ini_document::get_string().

◆ has_property()

bool ini_section::has_property ( const string & key) const
inlinenodiscard

检查属性是否存在

参数
key属性键名
返回
是否存在

在文件 ini_value.hpp298 行定义.

◆ operator=()

ini_section & ini_section::operator= ( ini_section && other)
defaultnoexcept

移动赋值运算符

参数
other源节对象
返回
自身引用

◆ set_name()

void ini_section::set_name ( string name)
inlinenoexcept

设置节名称

参数
name新的节名称

在文件 ini_value.hpp249 行定义.

引用了 move() , 以及 name().

◆ set_property()

void ini_section::set_property ( const string & key,
string value )
inline

设置属性

参数
key属性键名
value属性值

在文件 ini_value.hpp265 行定义.

引用了 make_unique() , 以及 move().

◆ type()

types ini_section::type ( ) const
inlinenodiscardoverridevirtualnoexcept

获取类型

返回
返回Section类型

实现了 ini_value.

在文件 ini_value.hpp231 行定义.

引用了 ini_value::Section.


该类的文档由以下文件生成: