diff --git a/Jupiter/INIFile.cpp b/Jupiter/INIFile.cpp index 414c1f8..a7f1d0c 100644 --- a/Jupiter/INIFile.cpp +++ b/Jupiter/INIFile.cpp @@ -378,12 +378,19 @@ Jupiter::INIFile::Section *Jupiter::INIFile::getSection(size_t index) const return Jupiter::INIFile::data_->data.get(index); } +Jupiter::INIFile::Section *Jupiter::INIFile::getSection(const Jupiter::ReadableString §ion) const +{ + for (size_t i = 0; i != Jupiter::INIFile::data_->data.size(); i++) + if (Jupiter::INIFile::data_->data.get(i)->getName().equalsi(section)) + return Jupiter::INIFile::data_->data.get(i); + return nullptr; +} + size_t Jupiter::INIFile::getSectionIndex(const Jupiter::ReadableString §ion) const { for (size_t i = 0; i != Jupiter::INIFile::data_->data.size(); i++) - { - if (Jupiter::INIFile::data_->data.get(i)->getName().equalsi(section)) return i; - } + if (Jupiter::INIFile::data_->data.get(i)->getName().equalsi(section)) + return i; return Jupiter::INVALID_INDEX; } diff --git a/Jupiter/INIFile.h b/Jupiter/INIFile.h index c4e7ae4..3e43b16 100644 --- a/Jupiter/INIFile.h +++ b/Jupiter/INIFile.h @@ -264,14 +264,22 @@ namespace Jupiter * @brief Returns a section. * * @param index Index of the section to get. - * @return String containing section if it exists, nullptr otherwise. + * @return Section if it exists, nullptr otherwise. */ Jupiter::INIFile::Section *getSection(size_t index) const; + /** + * @brief Returns a section. + * + * @param section Name of the section. + * @return Section if it exists, nullptr otherwise. + */ + Jupiter::INIFile::Section *getSection(const Jupiter::ReadableString §ion) const; + /** * @brief Returns the index of a section. * - * @param section The name of the section. + * @param section Name of the section. * @return The index of section if it exists, INVALID_INDEX (-1) otherwise. */ size_t getSectionIndex(const Jupiter::ReadableString §ion) const; diff --git a/Release/Jupiter.lib b/Release/Jupiter.lib index 2591e79..04b8243 100644 Binary files a/Release/Jupiter.lib and b/Release/Jupiter.lib differ