Reformat all the things!

This commit is contained in:
spycrab
2018-04-12 14:18:04 +02:00
parent d27e85e9d7
commit 40bb9974f2
179 changed files with 1888 additions and 991 deletions

View File

@ -731,12 +731,13 @@ void DirectoryBlobPartition::WriteDirectory(const File::FSTEntry& parent_entry,
std::vector<File::FSTEntry> sorted_entries = parent_entry.children;
// Sort for determinism
std::sort(sorted_entries.begin(), sorted_entries.end(), [](const File::FSTEntry& one,
const File::FSTEntry& two) {
const std::string one_upper = ASCIIToUppercase(one.virtualName);
const std::string two_upper = ASCIIToUppercase(two.virtualName);
return one_upper == two_upper ? one.virtualName < two.virtualName : one_upper < two_upper;
});
std::sort(sorted_entries.begin(), sorted_entries.end(),
[](const File::FSTEntry& one, const File::FSTEntry& two) {
const std::string one_upper = ASCIIToUppercase(one.virtualName);
const std::string two_upper = ASCIIToUppercase(two.virtualName);
return one_upper == two_upper ? one.virtualName < two.virtualName :
one_upper < two_upper;
});
for (const File::FSTEntry& entry : sorted_entries)
{

View File

@ -52,6 +52,7 @@ public:
bool operator>(const DiscContent& other) const { return other < *this; }
bool operator<=(const DiscContent& other) const { return !(*this < other); }
bool operator>=(const DiscContent& other) const { return !(*this > other); }
private:
u64 m_offset;
u64 m_size = 0;
@ -94,6 +95,7 @@ public:
const std::string& GetRootDirectory() const { return m_root_directory; }
const std::vector<u8>& GetHeader() const { return m_disc_header; }
const DiscContentContainer& GetContents() const { return m_contents; }
private:
void SetDiscHeaderAndDiscType(std::optional<bool> is_wii);
void SetBI2();

View File

@ -50,8 +50,9 @@ u64 ReadFile(const Volume& volume, const Partition& partition, const FileInfo* f
const u64 read_length = std::min(max_buffer_size, file_info->GetSize() - offset_in_file);
DEBUG_LOG(DISCIO, "Reading %" PRIx64 " bytes at %" PRIx64 " from file %s. Offset: %" PRIx64
" Size: %" PRIx32,
DEBUG_LOG(DISCIO,
"Reading %" PRIx64 " bytes at %" PRIx64 " from file %s. Offset: %" PRIx64
" Size: %" PRIx32,
read_length, offset_in_file, file_info->GetPath().c_str(), file_info->GetOffset(),
file_info->GetSize());

View File

@ -26,6 +26,7 @@ public:
BlobType GetBlobType() const override { return BlobType::DRIVE; }
u64 GetDataSize() const override { return m_size; }
u64 GetRawSize() const override { return m_size; }
private:
DriveReader(const std::string& drive);
bool GetBlock(u64 block_num, u8* out_ptr) override;

View File

@ -65,6 +65,7 @@ public:
// pointers, but will not invalidate copies of the iterator or file info object.
const FileInfo& operator*() const { return *m_file_info.get(); }
const FileInfo* operator->() const { return m_file_info.get(); }
private:
std::unique_ptr<FileInfo> m_file_info;
};

View File

@ -67,6 +67,7 @@ public:
protected:
u32 GetOffsetShift() const override { return 2; }
private:
struct PartitionDetails
{