Skip to content

Commit

Permalink
Merge pull request #6690 from lioncash/nand
Browse files Browse the repository at this point in the history
Common/NandPaths: Minor cleanup
  • Loading branch information
lioncash committed Apr 28, 2018
2 parents 6b8da19 + c1c360d commit 0cd46f4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
23 changes: 10 additions & 13 deletions Source/Core/Common/NandPaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include "Common/NandPaths.h"

#include <algorithm>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

#include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
#include "Common/NandPaths.h"
#include "Common/StringUtil.h"
#include "Common/Swap.h"

namespace Common
{
Expand All @@ -31,10 +28,10 @@ std::string GetImportTitlePath(u64 title_id, FromWhichRoot from)
static_cast<u32>(title_id));
}

std::string GetTicketFileName(u64 _titleID, FromWhichRoot from)
std::string GetTicketFileName(u64 title_id, FromWhichRoot from)
{
return StringFromFormat("%s/ticket/%08x/%08x.tik", RootUserPath(from).c_str(),
(u32)(_titleID >> 32), (u32)_titleID);
static_cast<u32>(title_id >> 32), static_cast<u32>(title_id));
}

std::string GetTitlePath(u64 title_id, FromWhichRoot from)
Expand All @@ -43,19 +40,19 @@ std::string GetTitlePath(u64 title_id, FromWhichRoot from)
static_cast<u32>(title_id >> 32), static_cast<u32>(title_id));
}

std::string GetTitleDataPath(u64 _titleID, FromWhichRoot from)
std::string GetTitleDataPath(u64 title_id, FromWhichRoot from)
{
return GetTitlePath(_titleID, from) + "data/";
return GetTitlePath(title_id, from) + "data/";
}

std::string GetTitleContentPath(u64 _titleID, FromWhichRoot from)
std::string GetTitleContentPath(u64 title_id, FromWhichRoot from)
{
return GetTitlePath(_titleID, from) + "content/";
return GetTitlePath(title_id, from) + "content/";
}

std::string GetTMDFileName(u64 _titleID, FromWhichRoot from)
std::string GetTMDFileName(u64 title_id, FromWhichRoot from)
{
return GetTitleContentPath(_titleID, from) + "title.tmd";
return GetTitleContentPath(title_id, from) + "title.tmd";
}

bool IsTitlePath(const std::string& path, FromWhichRoot from, u64* title_id)
Expand Down
10 changes: 4 additions & 6 deletions Source/Core/Common/NandPaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#pragma once

#include <string>
#include <utility>
#include <vector>

#include "Common/CommonTypes.h"

Expand All @@ -23,11 +21,11 @@ std::string RootUserPath(FromWhichRoot from);
// Returns /import/%08x/%08x. Intended for use by ES.
std::string GetImportTitlePath(u64 title_id, FromWhichRoot from = FROM_SESSION_ROOT);

std::string GetTicketFileName(u64 _titleID, FromWhichRoot from);
std::string GetTicketFileName(u64 title_id, FromWhichRoot from);
std::string GetTitlePath(u64 title_id, FromWhichRoot from);
std::string GetTitleDataPath(u64 _titleID, FromWhichRoot from);
std::string GetTitleContentPath(u64 _titleID, FromWhichRoot from);
std::string GetTMDFileName(u64 _titleID, FromWhichRoot from);
std::string GetTitleDataPath(u64 title_id, FromWhichRoot from);
std::string GetTitleContentPath(u64 title_id, FromWhichRoot from);
std::string GetTMDFileName(u64 title_id, FromWhichRoot from);

// Returns whether a path is within an installed title's directory.
bool IsTitlePath(const std::string& path, FromWhichRoot from, u64* title_id = nullptr);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/HW/GCMemcard/GCMemcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <algorithm>
#include <string>
#include <vector>

#include "Common/CommonTypes.h"
#include "Common/NandPaths.h"
Expand Down

0 comments on commit 0cd46f4

Please sign in to comment.