-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Movie: Make checking for existing GC saves more reliable #8535
Conversation
4a57e17
to
b9439d3
Compare
@@ -158,10 +158,39 @@ CEXIMemoryCard::CEXIMemoryCard(const int index, bool gciFolder) : card_index(ind | |||
SetCardFlashID(header.data(), card_index); | |||
} | |||
|
|||
void CEXIMemoryCard::SetupGciFolder(u16 sizeMb) | |||
std::string CEXIMemoryCard::GetGCIFolderPath(int card_index, bool allow_movie_folder, bool* migrate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this return a std::pair<std::string, bool>
to avoid the out-param?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could, but then there would be nothing in the function declaration that tells you what the bool means, so I think it's better the way it is right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not necessarily a problem.
std::pair<std::string /* ... */, bool /* migrate */>
is a common way to define a pair, then you can use structured bindings to unpack the pair on assignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question about structured bindings before I change this. Calling the modified function like this works:
const auto [strDirectoryName, migrate] = GetGCIFolderPath(card_index, true);
But is there a way to specify the type of the two variables separately, so that I don't have to use auto? That way you wouldn't have to look up the function to be able to know what types the two variables are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is there a way to specify the type of the two variables separately, so that I don't have to use auto?
No :(
What you could do is this:
std::string strDirectoryName;
bool migrate;
std::tie(strDirectoryName, migrate) = GetGCIFolderPath(card_index, true);
but then the variables are not const -.-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made it use a structured binding.
fdf79fb
to
29bcfbf
Compare
29bcfbf
to
ca38a81
Compare
ca38a81
to
5041cf1
Compare
The old code only handled a raw memory card in slot A, not taking GCI folders into account at all.
5041cf1
to
cb0fe3f
Compare
The old code only handled a raw memory card in slot A, not taking GCI folders into account at all.