Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'util/string_stream.hh')
-rw-r--r--util/string_stream.hh21
1 files changed, 7 insertions, 14 deletions
diff --git a/util/string_stream.hh b/util/string_stream.hh
index ee76a7a57..28fdd4219 100644
--- a/util/string_stream.hh
+++ b/util/string_stream.hh
@@ -10,14 +10,8 @@ namespace util {
class StringStream : public FakeOStream<StringStream> {
public:
- // Semantics: appends to string. Remember to clear first!
-
- explicit StringStream()
- {}
- /*
- explicit StringStream(std::string &out)
- : out_(out) {}
- */
+ StringStream() {}
+
StringStream &flush() { return *this; }
StringStream &write(const void *data, std::size_t length) {
@@ -25,12 +19,11 @@ class StringStream : public FakeOStream<StringStream> {
return *this;
}
- const std::string &str() const
- { return out_; }
- void str(const std::string &val)
- {
- out_ = val;
- }
+ const std::string &str() const { return out_; }
+
+ void str(const std::string &val) { out_ = val; }
+
+ void swap(std::string &str) { std::swap(out_, str); }
protected:
friend class FakeOStream<StringStream>;