diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-04-29 19:22:54 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-04-29 19:22:54 +0000 |
commit | 1edb424b734ea3e4f2128e1cbc77a22bd001f8d5 (patch) | |
tree | da3e95edf1ab1a1808ac6673811f76610f9dfce2 /lib/raidfile | |
parent | 1ce71f487e6cd6514198c3769cd0a337395c1f8e (diff) |
Add a ToString method to IOStream and some subclasses.
Useful to help debug problems such as invalid file headers when the source
of the stream might not be too obvious.
Diffstat (limited to 'lib/raidfile')
-rw-r--r-- | lib/raidfile/RaidFileRead.cpp | 7 | ||||
-rw-r--r-- | lib/raidfile/RaidFileRead.h | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/raidfile/RaidFileRead.cpp b/lib/raidfile/RaidFileRead.cpp index 9812411b..7591961f 100644 --- a/lib/raidfile/RaidFileRead.cpp +++ b/lib/raidfile/RaidFileRead.cpp @@ -1767,6 +1767,7 @@ IOStream::pos_type RaidFileRead::GetDiscUsageInBlocks() return RaidFileUtil::DiscUsageInBlocks(GetFileSize(), rdiscSet); } - - - +std::string RaidFileRead::ToString() const +{ + return std::string("RaidFile ") + mFilename; +} diff --git a/lib/raidfile/RaidFileRead.h b/lib/raidfile/RaidFileRead.h index 8a04409d..e746ed46 100644 --- a/lib/raidfile/RaidFileRead.h +++ b/lib/raidfile/RaidFileRead.h @@ -61,6 +61,7 @@ public: virtual pos_type BytesLeftToRead(); pos_type GetDiscUsageInBlocks(); + std::string ToString() const; typedef int64_t FileSizeType; |