llvm.org GIT mirror llvm / 3d4866e
Added "str()" method to raw_string_ostream. str() mirrors the same method in std::ostringstream. str() flushes the buffered stream contents to string and returns a reference to the string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55370 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 11 years ago
1 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
218218 raw_string_ostream(std::string &O) : OS(O) {}
219219 ~raw_string_ostream();
220220
221 /// str - Flushes the stream contents to the target string and returns
222 /// the strings reference.
223 std::string& str() {
224 flush();
225 return OS;
226 }
227
221228 /// flush_impl - The is the piece of the class that is implemented by
222229 /// subclasses. This outputs the currently buffered data and resets the
223230 /// buffer to empty.