summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/ResourceLocator.hpp7
-rw-r--r--test/core/ResourceLocatorTest.cpp7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/core/ResourceLocator.hpp b/src/core/ResourceLocator.hpp
index 5ca3ef3..2706aea 100644
--- a/src/core/ResourceLocator.hpp
+++ b/src/core/ResourceLocator.hpp
@@ -74,9 +74,9 @@ public:
* @param stream is an inputstream that gets the data of the Resource at
* this location.
*/
- void stream(std::istream &input) const
+ std::istream stream() const
{
- return locator.stream(location, input);
+ return std::move(locator.stream(location));
}
};
@@ -105,8 +105,7 @@ public:
* @param stream is an inputstream that gets the data of the Resource at
* this location.
*/
- virtual void stream(const std::string &location,
- std::istream &input) const;
+ virtual std::istream stream(const std::string &location) const;
};
}
diff --git a/test/core/ResourceLocatorTest.cpp b/test/core/ResourceLocatorTest.cpp
index 2e663f5..08259b6 100644
--- a/test/core/ResourceLocatorTest.cpp
+++ b/test/core/ResourceLocatorTest.cpp
@@ -35,14 +35,17 @@ class TestResourceLocator : public ResourceLocator {
return ResourceLocation(true, *this, type, path);
}
- std::istream stream(const std::string &location, std::istream& input) const override {
+ std::istream stream(const std::string &location) const override {
//trivial test implementation.
- input << "test";
+ std::stringstream ss;
+ ss << "test";
+ return std::move(ss);
}
};
TEST(ResourceLocator, locate)
{
+
}
}