diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2016-11-22 15:10:51 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2016-11-22 15:10:51 +0100 |
commit | a95e98a1f880be49f9ffcda01468b145b42e8b83 (patch) | |
tree | da140e666ebe14f665d759ecf7a8d535805fc327 /document | |
parent | 973bcbf9177d3ad979d56fbbe0e54ab8dcc54817 (diff) |
Add asciistream::StateSaver and use it in BucketSpace/BucketId
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/bucket/bucketid.cpp | 5 | ||||
-rw-r--r-- | document/src/vespa/document/bucket/bucketspace.cpp | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/document/src/vespa/document/bucket/bucketid.cpp b/document/src/vespa/document/bucket/bucketid.cpp index cea593e5fe2..520d3675982 100644 --- a/document/src/vespa/document/bucket/bucketid.cpp +++ b/document/src/vespa/document/bucket/bucketid.cpp @@ -125,13 +125,10 @@ BucketId::contains(const BucketId& id) const vespalib::asciistream& operator<<(vespalib::asciistream& os, const BucketId& id) { - size_t width = os.getWidth(); - char fill = os.getFill(); - vespalib::Base base = os.getBase(); + vespalib::asciistream::StateSaver stateSaver(os); return os << "BucketId(0x" << vespalib::hex << vespalib::setw(sizeof(BucketId::Type)*2) << vespalib::setfill('0') << id.getId() - << base << vespalib::setw(width) << vespalib::setfill(fill) << ")"; } diff --git a/document/src/vespa/document/bucket/bucketspace.cpp b/document/src/vespa/document/bucket/bucketspace.cpp index 8b5b46b393d..c29d229208f 100644 --- a/document/src/vespa/document/bucket/bucketspace.cpp +++ b/document/src/vespa/document/bucket/bucketspace.cpp @@ -19,13 +19,10 @@ void BucketSpace::print(std::ostream& os) const vespalib::asciistream& operator<<(vespalib::asciistream& os, const BucketSpace& id) { - size_t width = os.getWidth(); - char fill = os.getFill(); - vespalib::Base base = os.getBase(); + vespalib::asciistream::StateSaver stateSaver(os); return os << "BucketSpace(0x" << vespalib::hex << vespalib::setw(sizeof(BucketSpace::Type)*2) << vespalib::setfill('0') << id.getId() - << base << vespalib::setw(width) << vespalib::setfill(fill) << ")"; } |