Codechange: use std::string for text file name resolution
This commit is contained in:
@@ -49,11 +49,11 @@ bool ContentInfo::IsValid() const
|
||||
/**
|
||||
* Search a textfile file next to this file in the content list.
|
||||
* @param type The type of the textfile to search for.
|
||||
* @return The filename for the textfile, \c nullptr otherwise.
|
||||
* @return The filename for the textfile.
|
||||
*/
|
||||
const char *ContentInfo::GetTextfile(TextfileType type) const
|
||||
std::optional<std::string> ContentInfo::GetTextfile(TextfileType type) const
|
||||
{
|
||||
if (this->state == INVALID) return nullptr;
|
||||
if (this->state == INVALID) return std::nullopt;
|
||||
const char *tmp;
|
||||
switch (this->type) {
|
||||
default: NOT_REACHED();
|
||||
@@ -88,7 +88,7 @@ const char *ContentInfo::GetTextfile(TextfileType type) const
|
||||
tmp = FindScenario(this, true);
|
||||
break;
|
||||
}
|
||||
if (tmp == nullptr) return nullptr;
|
||||
if (tmp == nullptr) return std::nullopt;
|
||||
return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user