Skip to content

Commit

Permalink
#5108: Use std::ifstream to read from absolute filesystem paths inste…
Browse files Browse the repository at this point in the history
…ad of the custom TextFileInputStream.
  • Loading branch information
codereader committed Nov 27, 2020
1 parent 7e63672 commit c3a01d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion libs/debugging/ScopedDebugTimer.h
Expand Up @@ -36,7 +36,6 @@
#endif

#include <string>
#include "stream/TextFileInputStream.h"

namespace {

Expand Down
1 change: 0 additions & 1 deletion plugins/sound/SoundPlayer.cpp
Expand Up @@ -5,7 +5,6 @@
#include <vector>
#include "string/case_conv.h"

#include "stream/TextFileInputStream.h"
#include "os/path.h"
#include <memory>

Expand Down
1 change: 0 additions & 1 deletion radiantcore/map/Map.cpp
Expand Up @@ -24,7 +24,6 @@
#include "imapformat.h"

#include "registry/registry.h"
#include "stream/TextFileInputStream.h"
#include "entitylib.h"
#include "gamelib.h"
#include "os/path.h"
Expand Down
15 changes: 6 additions & 9 deletions radiantcore/map/MapResource.cpp
Expand Up @@ -21,7 +21,6 @@
#include "os/file.h"
#include "os/fs.h"
#include "scene/Traverse.h"
#include "stream/TextFileInputStream.h"
#include "scenelib.h"

#include <functional>
Expand Down Expand Up @@ -384,15 +383,13 @@ void MapResource::openFileStream(const std::string& path, const std::function<vo
{
rMessage() << "Open file " << path << " from filesystem...";

TextFileInputStream file(path);
std::ifstream stream(path);

if (file.failed())
{
rError() << "failure" << std::endl;
throw OperationException(fmt::format(_("Failure opening file:\n{0}"), path));
}

std::istream stream(&file);
if (!stream)
{
rError() << "failure" << std::endl;
throw OperationException(fmt::format(_("Failure opening file:\n{0}"), path));
}

rMessage() << "success." << std::endl;

Expand Down

0 comments on commit c3a01d0

Please sign in to comment.