summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-05-27 18:21:59 -0400
committerLioncash <mathew1800@gmail.com>2018-05-27 18:30:58 -0400
commit1f75fa0aff03245417ce4c35ae4730e2b33fe5f1 (patch)
tree8298784d531dbb25cbc11531cbda65b8d0cfb531 /Source/Core
parent5fdf171967ddb63d12f9f410178d6b7bc7115ee4 (diff)
CDUtils: Namespace code under the Common namespace
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/CDUtils.cpp3
-rw-r--r--Source/Core/Common/CDUtils.h3
-rw-r--r--Source/Core/Core/Boot/Boot.cpp2
-rw-r--r--Source/Core/DiscIO/Blob.cpp2
-rw-r--r--Source/Core/DolphinQt2/MenuBar.cpp2
-rw-r--r--Source/Core/DolphinWX/GameListCtrl.cpp2
-rw-r--r--Source/Core/DolphinWX/MainMenuBar.cpp2
7 files changed, 11 insertions, 5 deletions
diff --git a/Source/Core/Common/CDUtils.cpp b/Source/Core/Common/CDUtils.cpp
index c829189cf9..d3f0221fef 100644
--- a/Source/Core/Common/CDUtils.cpp
+++ b/Source/Core/Common/CDUtils.cpp
@@ -34,6 +34,8 @@
#include <linux/cdrom.h>
#endif
+namespace Common
+{
#ifdef _WIN32
// takes a root drive path, returns true if it is a cdrom drive
bool is_cdrom(const TCHAR* drive)
@@ -219,3 +221,4 @@ bool cdio_is_cdrom(std::string device)
}
return false;
}
+} // namespace Common
diff --git a/Source/Core/Common/CDUtils.h b/Source/Core/Common/CDUtils.h
index 8c768dac37..f74f10640a 100644
--- a/Source/Core/Common/CDUtils.h
+++ b/Source/Core/Common/CDUtils.h
@@ -7,8 +7,11 @@
#include <string>
#include <vector>
+namespace Common
+{
// Returns a pointer to an array of strings with the device names
std::vector<std::string> cdio_get_devices();
// Returns true if device is cdrom/dvd
bool cdio_is_cdrom(std::string device);
+} // namespace Common
diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp
index 28e52119f9..6c868cbf88 100644
--- a/Source/Core/Core/Boot/Boot.cpp
+++ b/Source/Core/Core/Boot/Boot.cpp
@@ -62,7 +62,7 @@ std::unique_ptr<BootParameters>
BootParameters::GenerateFromFile(const std::string& path,
const std::optional<std::string>& savestate_path)
{
- const bool is_drive = cdio_is_cdrom(path);
+ const bool is_drive = Common::cdio_is_cdrom(path);
// Check if the file exist, we may have gotten it from a --elf command line
// that gave an incorrect file name
if (!is_drive && !File::Exists(path))
diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp
index 5e603610b2..477daafd40 100644
--- a/Source/Core/DiscIO/Blob.cpp
+++ b/Source/Core/DiscIO/Blob.cpp
@@ -176,7 +176,7 @@ u32 SectorReader::ReadChunk(u8* buffer, u64 chunk_num)
std::unique_ptr<BlobReader> CreateBlobReader(const std::string& filename)
{
- if (cdio_is_cdrom(filename))
+ if (Common::cdio_is_cdrom(filename))
return DriveReader::Create(filename);
File::IOFile file(filename, "rb");
diff --git a/Source/Core/DolphinQt2/MenuBar.cpp b/Source/Core/DolphinQt2/MenuBar.cpp
index 178beb12d6..96cc4d8f6f 100644
--- a/Source/Core/DolphinQt2/MenuBar.cpp
+++ b/Source/Core/DolphinQt2/MenuBar.cpp
@@ -166,7 +166,7 @@ void MenuBar::AddDVDBackupMenu(QMenu* file_menu)
{
m_backup_menu = file_menu->addMenu(tr("&Boot from DVD Backup"));
- const std::vector<std::string> drives = cdio_get_devices();
+ const std::vector<std::string> drives = Common::cdio_get_devices();
// Windows Limitation of 24 character drives
for (size_t i = 0; i < drives.size() && i < 24; i++)
{
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp
index fcf0aa3d0f..89d6fc2302 100644
--- a/Source/Core/DolphinWX/GameListCtrl.cpp
+++ b/Source/Core/DolphinWX/GameListCtrl.cpp
@@ -397,7 +397,7 @@ void GameListCtrl::RefreshList()
if (SConfig::GetInstance().m_ListDrives)
{
std::unique_lock<std::mutex> lk(m_title_database_mutex);
- for (const auto& drive : cdio_get_devices())
+ for (const auto& drive : Common::cdio_get_devices())
{
auto file = std::make_shared<UICommon::GameFile>(drive);
if (file->IsValid())
diff --git a/Source/Core/DolphinWX/MainMenuBar.cpp b/Source/Core/DolphinWX/MainMenuBar.cpp
index 01d3ac2ad7..d58a2d7cf6 100644
--- a/Source/Core/DolphinWX/MainMenuBar.cpp
+++ b/Source/Core/DolphinWX/MainMenuBar.cpp
@@ -72,7 +72,7 @@ wxMenu* MainMenuBar::CreateFileMenu() const
{
auto* const external_drive_menu = new wxMenu;
- const std::vector<std::string> drives = cdio_get_devices();
+ const std::vector<std::string> drives = Common::cdio_get_devices();
// Windows Limitation of 24 character drives
for (size_t i = 0; i < drives.size() && i < 24; i++)
{