Skip to content

Commit 989ecfd

Browse files
committed
add ostream support to StringStore
1 parent 784810b commit 989ecfd

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/string19.lib/string19/Rope.decimal.test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
#include "Rope.StringView.h"
44
#include "Rope.store.h"
55
#include "StringStore.literal.h"
6+
#include "StringStore.ostream.h"
67
#include "StringView.equals.h"
78
#include "StringView.literal.h"
9+
#include "StringView.ostream.h"
810
#include "StringView.store.h"
911

1012
#include <gtest/gtest.h>

src/string19.lib/string19/Rope.test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "Rope.char.h"
44
#include "Rope.store.h"
55
#include "StringStore.literal.h"
6+
#include "StringStore.ostream.h"
67
#include "StringView.equals.h"
78
#include "StringView.literal.h"
89
#include "StringView.store.h"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
#include "StringStore.h"
3+
4+
#include <ostream>
5+
6+
namespace string19 {
7+
8+
template<size_t N> inline auto operator<<(std::ostream& out, const StringStore<N>& v) -> std::ostream& {
9+
return out.write(v.data, v.count);
10+
}
11+
12+
} // namespace string19

src/string19.lib/string19/string19.qbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Product {
2727
files: [
2828
"StringStore.h",
2929
"StringStore.literal.h",
30+
"StringStore.ostream.h",
3031
"StringStore.range.h",
3132
]
3233
}

0 commit comments

Comments
 (0)