Skip to content

Commit

Permalink
No direct inclusion of boost/filesystem.hpp, everything is using os/f…
Browse files Browse the repository at this point in the history
…s.h and refers to fs namespace.
  • Loading branch information
codereader committed Jul 15, 2017
1 parent 44ac0a4 commit f6be0a1
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 32 deletions.
3 changes: 0 additions & 3 deletions plugins/dm.gui/ReadableEditorDialog.cpp
Expand Up @@ -11,9 +11,6 @@
#include "selectionlib.h"
#include "wxutil/dialog/MessageBox.h"

#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem.hpp>

#include "registry/registry.h"
#include "string/string.h"
#include "os/file.h"
Expand Down
8 changes: 4 additions & 4 deletions plugins/particles/editor/ParticleEditor.cpp
Expand Up @@ -26,11 +26,11 @@

#include "../ParticlesManager.h"

#include "os/fs.h"
#include "os/file.h"
#include "os/path.h"
#include "util/ScopedBoolLock.h"

#include <boost/filesystem.hpp>
#include <boost/algorithm/string/predicate.hpp>

namespace ui
Expand Down Expand Up @@ -1026,7 +1026,7 @@ void ParticleEditor::updateWidgetsFromParticle()
updateWidgetsFromStage();

// Update outfile label
boost::filesystem::path outFile = GlobalGameManager().getModPath();
fs::path outFile = GlobalGameManager().getModPath();
outFile /= PARTICLES_DIR;
outFile /= _currentDef->getFilename();

Expand Down Expand Up @@ -1504,13 +1504,13 @@ std::string ParticleEditor::queryParticleFile()
// Get the filename we should save this particle into
wxutil::FileChooser chooser(this, _("Select .prt file"), false, "particle", ".prt");

boost::filesystem::path modParticlesPath = GlobalGameManager().getModPath();
fs::path modParticlesPath = GlobalGameManager().getModPath();
modParticlesPath /= "particles";

if (!os::fileOrDirExists(modParticlesPath.string()))
{
rMessage() << "Ensuring mod particles path: " << modParticlesPath << std::endl;
boost::filesystem::create_directories(modParticlesPath);
fs::create_directories(modParticlesPath);
}

// Point the file chooser to that new file
Expand Down
2 changes: 0 additions & 2 deletions plugins/vfspk3/SortedFilenames.h
@@ -1,7 +1,5 @@
#pragma once

#include <boost/filesystem.hpp>

/**
* greebo: SortedFilenames is based on a std::set
* container with special sorting.
Expand Down
9 changes: 3 additions & 6 deletions radiant/log/PIDFile.h
@@ -1,11 +1,10 @@
#ifndef _PID_FILE_H_
#define _PID_FILE_H_
#pragma once

#include "wxutil/dialog/MessageBox.h"
#include "settings/PreferenceSystem.h"
#include "modulesystem/ModuleRegistry.h"

#include <boost/filesystem.hpp>
#include "os/file.h"
#include <boost/algorithm/string/replace.hpp>

#define PID_FILENAME "darkradiant.pid"
Expand Down Expand Up @@ -37,7 +36,7 @@ class PIDFile
removePIDFile();

#ifndef _DEBUG
boost::filesystem::path path = registry.getApplicationContext().getSettingsPath();
fs::path path = registry.getApplicationContext().getSettingsPath();
path /= "darkradiant.log";
std::string logPath = path.string();
boost::algorithm::replace_all(logPath, "\\\\", "\\");
Expand Down Expand Up @@ -77,5 +76,3 @@ class PIDFile
};

} // namespace applog

#endif /* _PID_FILE_H_ */
1 change: 0 additions & 1 deletion radiant/map/MapResource.cpp
Expand Up @@ -28,7 +28,6 @@

#include <functional>
#include <boost/format.hpp>
#include <boost/filesystem.hpp>

#include "infofile/InfoFile.h"
#include "string/string.h"
Expand Down
14 changes: 2 additions & 12 deletions radiant/map/StartupMapLoader.cpp
Expand Up @@ -11,7 +11,6 @@

#include "os/path.h"
#include "os/file.h"
#include <boost/filesystem.hpp>

namespace map
{
Expand Down Expand Up @@ -47,25 +46,16 @@ void StartupMapLoader::onRadiantStartup()
break;
}

boost::filesystem::path mapsPath = GlobalRegistry().get(RKEY_MAP_PATH);
fs::path mapsPath = GlobalRegistry().get(RKEY_MAP_PATH);

boost::filesystem::path fullMapPath = mapsPath / candidate;
fs::path fullMapPath = mapsPath / candidate;

// Next, look in the regular maps path
if (os::fileOrDirExists(fullMapPath.string()))
{
mapToLoad = fullMapPath.string();
break;
}

// Check for mod-relative paths too
fullMapPath = mapsPath.remove_leaf().remove_leaf() / candidate;

if (os::fileOrDirExists(fullMapPath.string()))
{
mapToLoad = fullMapPath.string();
break;
}
}

if (!mapToLoad.empty())
Expand Down
1 change: 0 additions & 1 deletion radiant/model/ScaledModelExporter.cpp
Expand Up @@ -8,7 +8,6 @@
#include "iscenegraph.h"
#include "os/fs.h"
#include "os/path.h"
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <regex>
Expand Down
6 changes: 3 additions & 3 deletions radiant/modulesystem/ApplicationContextImpl.cpp
Expand Up @@ -5,13 +5,13 @@
#include "debugging/debugging.h"
#include "itextstream.h"
#include "iregistry.h"
#include "os/fs.h"
#include "os/path.h"
#include "os/dir.h"
#include "log/PopupErrorHandler.h"
#include "log/LogStream.h"

#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>

#if defined(WIN32)
#include <windows.h>
Expand Down Expand Up @@ -110,8 +110,8 @@ std::string getExecutablePath(char* argv[])
if (ret > 0)
{
// Success
boost::filesystem::path execPath = std::string(pathBuf);
boost::filesystem::path appPath = execPath.remove_leaf();
fs::path execPath = std::string(pathBuf);
fs::path appPath = execPath.remove_leaf();

rConsole() << "Application path: " << appPath << std::endl;

Expand Down

0 comments on commit f6be0a1

Please sign in to comment.