diff options
author | valmat <ufabiz@gmail.com> | 2014-04-13 21:20:52 +0600 |
---|---|---|
committer | valmat <ufabiz@gmail.com> | 2014-04-13 21:20:52 +0600 |
commit | 9b2ac923e4bf98ca76441362b1d15e58de4297c8 (patch) | |
tree | bab2b2e67b526550f9bfced48395f260ae36ad55 /zend/ini.cpp | |
parent | 7df281b04d7286cd1cf7cad55848b6bf4a250c24 (diff) |
Class IniValue designed for extracting values from ini entries
Diffstat (limited to 'zend/ini.cpp')
-rw-r--r-- | zend/ini.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/zend/ini.cpp b/zend/ini.cpp index 25f081a..e7d9292 100644 --- a/zend/ini.cpp +++ b/zend/ini.cpp @@ -48,6 +48,35 @@ void Ini::fill(zend_ini_entry *ini_entry, int module_number) ini_entry->displayer = nullptr; } + +/** + * Cast to a number + * @return uint64_t + */ +int64_t IniValue::numericValue() const +{ + return zend_ini_long(const_cast<char*>(_name.c_str()), _name.size()+1, _isorig); + +} + +/** + * Get access to the raw buffer for read operationrs. + * @return const char * + */ +const char* IniValue::rawValue() const +{ + return zend_ini_string(const_cast<char*>(_name.c_str()), _name.size()+1, _isorig); +} + +/** + * Cast to a floating point + * @return double + */ +IniValue::operator double() const +{ + return zend_ini_double(const_cast<char*>(_name.c_str()), _name.size()+1, _isorig); +} + /** * End of namespace */ |