Skip to content
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

Open
wants to merge 1 commit into
base: master
from

Conversation

@JosJuice
Copy link
Member

JosJuice commented Dec 27, 2019

The old code only handled a raw memory card in slot A, not taking GCI folders into account at all.

@JosJuice JosJuice force-pushed the JosJuice:movie-save-detection branch from 1f5e386 to 4a57e17 Dec 27, 2019
The old code only handled a raw memory card in slot A, not taking
GCI folders into account at all.
@JosJuice JosJuice force-pushed the JosJuice:movie-save-detection branch from 4a57e17 to b9439d3 Dec 27, 2019
@@ -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)

This comment has been minimized.

Copy link
@Warepire

Warepire Dec 27, 2019

Can this return a std::pair<std::string, bool> to avoid the out-param?

This comment has been minimized.

Copy link
@JosJuice

JosJuice Dec 28, 2019

Author Member

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.

This comment has been minimized.

Copy link
@Warepire

Warepire Dec 28, 2019

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.

This comment has been minimized.

Copy link
@JosJuice

JosJuice Dec 28, 2019

Author Member

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.

This comment has been minimized.

Copy link
@Tilka

Tilka Jan 25, 2020

Member

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 -.-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.