| 1 | // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) |
| 2 | // (C) Copyright 2004-2007 Jonathan Turkanis |
| 3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) |
| 5 | |
| 6 | // See http://www.boost.org/libs/iostreams for documentation. |
| 7 | |
| 8 | #ifndef BOOST_IOSTREAMS_TEST_SEQUENCE_HPP_INCLUDED |
| 9 | #define BOOST_IOSTREAMS_TEST_SEQUENCE_HPP_INCLUDED |
| 10 | |
| 11 | #include <algorithm> |
| 12 | #include <iterator> |
| 13 | #include <string.h> // strlen. |
| 14 | #include <vector> |
| 15 | #include <boost/iostreams/detail/default_arg.hpp> |
| 16 | #include "./constants.hpp" |
| 17 | |
| 18 | namespace boost { namespace iostreams { namespace test { |
| 19 | |
| 20 | template<typename Ch = BOOST_IOSTREAMS_DEFAULT_ARG(char) > |
| 21 | struct test_sequence : public std::vector<Ch> { |
| 22 | test_sequence() |
| 23 | { |
| 24 | const Ch* buf = test::detail::data((Ch*)0); |
| 25 | this->reserve(data_reps * data_length()); |
| 26 | for (int z = 0; z < data_reps; ++z) |
| 27 | std::copy(buf, buf + data_length(), std::back_inserter(*this)); |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | const char* text = |
| 32 | "The Lord spoke to Moses saying: Speak to the children of " |
| 33 | "Israel, and have them take for Me an offering; from every " |
| 34 | "person whose heart inspires him to generosity, you shall take " |
| 35 | "My offering. And this is the offering that you shall take " |
| 36 | "from them: gold, silver, and copper; blue, purple, and " |
| 37 | "crimson wool; linen and goat hair; ram skins dyed red, " |
| 38 | "tachash skins, and acacia wood; oil for lighting, spices for " |
| 39 | "the anointing oil and for the incense; shoham stones and " |
| 40 | "filling stones for the ephod and for the choshen. And they " |
| 41 | "shall make Me a sanctuary and I will dwell in their midst " |
| 42 | "according to all that I show you, the pattern of the Mishkan " |
| 43 | "and the pattern of all its vessels; and so shall you do. They " |
| 44 | "shall make an ark of acacia wood, two and a half cubits its " |
| 45 | "length, a cubit and a half its width, and a cubit and a half " |
| 46 | "its height. And you shall overlay it with pure gold; from " |
| 47 | "inside and from outside you shall overlay it, and you shall " |
| 48 | "make upon it a golden crown all around. And you shall cast " |
| 49 | "four golden rings for it, and you shall place them upon its " |
| 50 | "four corners, two rings on its one side, and two rings on its " |
| 51 | "other side. And you shall make poles of acacia wood and you " |
| 52 | "shall overlay them with gold. And you shall bring the poles " |
| 53 | "into the rings on the sides of the ark, to carry the ark with " |
| 54 | "them. The poles of the ark shall be in the rings; they shall " |
| 55 | "not be removed from it. And you shall place into the ark the " |
| 56 | "testimony, which I will give you. " |
| 57 | "And you shall make an ark cover of pure gold, two and a half " |
| 58 | "cubits its length and a cubit and a half its width. And you " |
| 59 | "shall make two golden cherubim; you shall make them of " |
| 60 | "hammered work, from the two ends of the ark cover. And make " |
| 61 | "one cherub from the one end and the other cherub from the " |
| 62 | "other end; from the ark cover you shall make the cherubim on " |
| 63 | "its two ends. The cherubim shall have their wings spread " |
| 64 | "upwards, shielding the ark cover with their wings, with their " |
| 65 | "faces toward one another; [turned] toward the ark cover shall " |
| 66 | "be the faces of the cherubim. And you shall place the ark " |
| 67 | "cover on the ark from above, and into the ark you shall place " |
| 68 | "the testimony, which I will give you. I will arrange My " |
| 69 | "meetings with you there, and I will speak with you from atop " |
| 70 | "the ark cover from between the two cherubim that are upon the " |
| 71 | "Ark of the Testimony, all that I will command you unto the " |
| 72 | "children of Israel. And you shall make a table of acacia " |
| 73 | "wood, two cubits its length, one cubit its width, and a cubit " |
| 74 | "and a half its height. And you shall overlay it with pure " |
| 75 | "gold, and you shall make for it a golden crown all around. " |
| 76 | "And you shall make for it a frame a handbreadth [wide] all " |
| 77 | "around, and you shall make a golden crown for its frame all " |
| 78 | "around. And you shall make for it four golden rings, and you " |
| 79 | "shall place the rings on the four corners that are on its " |
| 80 | "four legs. The rings shall be opposite the frame as holders " |
| 81 | "for the poles [with which] to carry the table. And you shall " |
| 82 | "make the poles of acacia wood, and you shall overlay them " |
| 83 | "with gold, and the table shall be carried with them. And you " |
| 84 | "shall make its forms, its spoons, its half pipes, and its " |
| 85 | "supports with which it will be covered; of pure gold you " |
| 86 | "shall make them. And you shall place on the table showbread " |
| 87 | "before Me at all times. " |
| 88 | "And you shall make a menorah of pure gold. The menorah shall " |
| 89 | "be made of hammered work; its base and its stem, its goblets, " |
| 90 | "its knobs, and its flowers shall [all] be [one piece] with " |
| 91 | "it. And six branches coming out of its sides: three menorah " |
| 92 | "branches from its one side and three menorah branches from " |
| 93 | "its second side. Three decorated goblets on one branch, a " |
| 94 | "knob and a flower, and three decorated goblets on one branch, " |
| 95 | "a knob and a flower; so for the six branches that come out of " |
| 96 | "the menorah. And on [the stem of] the menorah [shall be] four " |
| 97 | "decorated goblets, its knobs and its flowers. And a knob under " |
| 98 | "the two branches from it, and a knob under the two branches " |
| 99 | "from it, and a knob under the two branches from it; so for the " |
| 100 | "six branches that come out of the menorah. Their knobs and " |
| 101 | "their branches shall [all] be [one piece] with it; all of it " |
| 102 | |
| 103 | "[shall be] one hammered mass of pure gold. And you shall make " |
| 104 | "its lamps seven, and he shall kindle its lamps [so that they] " |
| 105 | "shed light toward its face. And its tongs and its scoops " |
| 106 | "[shall be] of pure gold. He shall make it of a talent of pure " |
| 107 | "gold, with all these implements. Now see and make according " |
| 108 | "to their pattern, which you are shown on the mountain. " |
| 109 | "And the Mishkan you shall make out of ten curtains " |
| 110 | "[consisting] of twisted fine linen, and blue, purple, and " |
| 111 | "crimson wool. A cherubim design of the work of a master " |
| 112 | "weaver you shall make them. The length of one curtain [shall " |
| 113 | "be] twenty eight cubits, and the width of one curtain [shall " |
| 114 | "be] four cubits; the same measure for all the curtains. Five " |
| 115 | "of these curtains shall be joined to one another, and [the " |
| 116 | "other] five curtains shall [also] be joined to one another. " |
| 117 | "And you shall make loops of blue wool on the edge of one " |
| 118 | "curtain [that is] at the edge of the [first] set, and so " |
| 119 | "shall you do on the edge of the outermost curtain of the " |
| 120 | "second set. You shall make fifty loops on [the edge of] one " |
| 121 | "curtain, and you shall make fifty loops on the edge of the " |
| 122 | "curtain in the second set; the loops shall correspond to one " |
| 123 | "another. And you shall make fifty golden clasps, and you " |
| 124 | "shall fasten the curtains to one another with the clasps; so " |
| 125 | "shall the Mishkan become one. And [then] you shall make " |
| 126 | "curtains of goat hair for a tent over the Mishkan; you shall " |
| 127 | "make eleven curtains. The length of one curtain [shall be] " |
| 128 | "thirty cubits, and the width of one curtain four cubits; the " |
| 129 | "same measure for the eleven curtains. And you shall join the " |
| 130 | "five curtains by themselves, and the [other] six curtains by " |
| 131 | "themselves; and you shall fold the sixth curtain before the " |
| 132 | "front of the tent. And you shall make fifty loops on the edge " |
| 133 | "of one curtain, [which is] at the edge of the [first] set, and " |
| 134 | "fifty loops on the edge of the [outermost] curtain of the " |
| 135 | "second set. And you shall make fifty copper clasps; you shall " |
| 136 | "bring the clasps into the loops, and you shall fasten the " |
| 137 | "tent together so that it will become one. And the overhanging " |
| 138 | "excess in the curtains of the tent half of the extra curtain " |
| 139 | "shall hang over the rear of the Mishkan. And the cubit from " |
| 140 | "here and the cubit from there of the excess in the length of " |
| 141 | "the curtains of the tent shall hang over the sides of the " |
| 142 | "Mishkan from here and from there to cover it. And you shall " |
| 143 | "make a covering for the tent of ram skins dyed red and a " |
| 144 | "covering of tachash skins above." ; |
| 145 | |
| 146 | struct text_sequence : public std::vector<char> { |
| 147 | text_sequence() |
| 148 | { |
| 149 | const char* c = |
| 150 | "The Lord spoke to Moses saying: Speak to the children of " |
| 151 | "Israel, and have them take for Me an offering; from every " |
| 152 | "person whose heart inspires him to generosity, you shall take " |
| 153 | "My offering. And this is the offering that you shall take " |
| 154 | "from them: gold, silver, and copper; blue, purple, and " |
| 155 | "crimson wool; linen and goat hair; ram skins dyed red, " |
| 156 | "tachash skins, and acacia wood; oil for lighting, spices for " |
| 157 | "the anointing oil and for the incense; shoham stones and " |
| 158 | "filling stones for the ephod and for the choshen. And they " |
| 159 | "shall make Me a sanctuary and I will dwell in their midst " |
| 160 | "according to all that I show you, the pattern of the Mishkan " |
| 161 | "and the pattern of all its vessels; and so shall you do. They " |
| 162 | "shall make an ark of acacia wood, two and a half cubits its " |
| 163 | "length, a cubit and a half its width, and a cubit and a half " |
| 164 | "its height. And you shall overlay it with pure gold; from " |
| 165 | "inside and from outside you shall overlay it, and you shall " |
| 166 | "make upon it a golden crown all around. And you shall cast " |
| 167 | "four golden rings for it, and you shall place them upon its " |
| 168 | "four corners, two rings on its one side, and two rings on its " |
| 169 | "other side. And you shall make poles of acacia wood and you " |
| 170 | "shall overlay them with gold. And you shall bring the poles " |
| 171 | "into the rings on the sides of the ark, to carry the ark with " |
| 172 | "them. The poles of the ark shall be in the rings; they shall " |
| 173 | "not be removed from it. And you shall place into the ark the " |
| 174 | "testimony, which I will give you. " |
| 175 | "And you shall make an ark cover of pure gold, two and a half " |
| 176 | "cubits its length and a cubit and a half its width. And you " |
| 177 | "shall make two golden cherubim; you shall make them of " |
| 178 | "hammered work, from the two ends of the ark cover. And make " |
| 179 | "one cherub from the one end and the other cherub from the " |
| 180 | "other end; from the ark cover you shall make the cherubim on " |
| 181 | "its two ends. The cherubim shall have their wings spread " |
| 182 | "upwards, shielding the ark cover with their wings, with their " |
| 183 | "faces toward one another; [turned] toward the ark cover shall " |
| 184 | "be the faces of the cherubim. And you shall place the ark " |
| 185 | "cover on the ark from above, and into the ark you shall place " |
| 186 | "the testimony, which I will give you. I will arrange My " |
| 187 | "meetings with you there, and I will speak with you from atop " |
| 188 | "the ark cover from between the two cherubim that are upon the " |
| 189 | "Ark of the Testimony, all that I will command you unto the " |
| 190 | "children of Israel. And you shall make a table of acacia " |
| 191 | "wood, two cubits its length, one cubit its width, and a cubit " |
| 192 | "and a half its height. And you shall overlay it with pure " |
| 193 | "gold, and you shall make for it a golden crown all around. " |
| 194 | "And you shall make for it a frame a handbreadth [wide] all " |
| 195 | "around, and you shall make a golden crown for its frame all " |
| 196 | "around. And you shall make for it four golden rings, and you " |
| 197 | "shall place the rings on the four corners that are on its " |
| 198 | "four legs. The rings shall be opposite the frame as holders " |
| 199 | "for the poles [with which] to carry the table. And you shall " |
| 200 | "make the poles of acacia wood, and you shall overlay them " |
| 201 | "with gold, and the table shall be carried with them. And you " |
| 202 | "shall make its forms, its spoons, its half pipes, and its " |
| 203 | "supports with which it will be covered; of pure gold you " |
| 204 | "shall make them. And you shall place on the table showbread " |
| 205 | "before Me at all times. " |
| 206 | "And you shall make a menorah of pure gold. The menorah shall " |
| 207 | "be made of hammered work; its base and its stem, its goblets, " |
| 208 | "its knobs, and its flowers shall [all] be [one piece] with " |
| 209 | "it. And six branches coming out of its sides: three menorah " |
| 210 | "branches from its one side and three menorah branches from " |
| 211 | "its second side. Three decorated goblets on one branch, a " |
| 212 | "knob and a flower, and three decorated goblets on one branch, " |
| 213 | "a knob and a flower; so for the six branches that come out of " |
| 214 | "the menorah. And on [the stem of] the menorah [shall be] four " |
| 215 | "decorated goblets, its knobs and its flowers. And a knob under " |
| 216 | "the two branches from it, and a knob under the two branches " |
| 217 | "from it, and a knob under the two branches from it; so for the " |
| 218 | "six branches that come out of the menorah. Their knobs and " |
| 219 | "their branches shall [all] be [one piece] with it; all of it " |
| 220 | |
| 221 | "[shall be] one hammered mass of pure gold. And you shall make " |
| 222 | "its lamps seven, and he shall kindle its lamps [so that they] " |
| 223 | "shed light toward its face. And its tongs and its scoops " |
| 224 | "[shall be] of pure gold. He shall make it of a talent of pure " |
| 225 | "gold, with all these implements. Now see and make according " |
| 226 | "to their pattern, which you are shown on the mountain. " |
| 227 | "And the Mishkan you shall make out of ten curtains " |
| 228 | "[consisting] of twisted fine linen, and blue, purple, and " |
| 229 | "crimson wool. A cherubim design of the work of a master " |
| 230 | "weaver you shall make them. The length of one curtain [shall " |
| 231 | "be] twenty eight cubits, and the width of one curtain [shall " |
| 232 | "be] four cubits; the same measure for all the curtains. Five " |
| 233 | "of these curtains shall be joined to one another, and [the " |
| 234 | "other] five curtains shall [also] be joined to one another. " |
| 235 | "And you shall make loops of blue wool on the edge of one " |
| 236 | "curtain [that is] at the edge of the [first] set, and so " |
| 237 | "shall you do on the edge of the outermost curtain of the " |
| 238 | "second set. You shall make fifty loops on [the edge of] one " |
| 239 | "curtain, and you shall make fifty loops on the edge of the " |
| 240 | "curtain in the second set; the loops shall correspond to one " |
| 241 | "another. And you shall make fifty golden clasps, and you " |
| 242 | "shall fasten the curtains to one another with the clasps; so " |
| 243 | "shall the Mishkan become one. And [then] you shall make " |
| 244 | "curtains of goat hair for a tent over the Mishkan; you shall " |
| 245 | "make eleven curtains. The length of one curtain [shall be] " |
| 246 | "thirty cubits, and the width of one curtain four cubits; the " |
| 247 | "same measure for the eleven curtains. And you shall join the " |
| 248 | "five curtains by themselves, and the [other] six curtains by " |
| 249 | "themselves; and you shall fold the sixth curtain before the " |
| 250 | "front of the tent. And you shall make fifty loops on the edge " |
| 251 | "of one curtain, [which is] at the edge of the [first] set, and " |
| 252 | "fifty loops on the edge of the [outermost] curtain of the " |
| 253 | "second set. And you shall make fifty copper clasps; you shall " |
| 254 | "bring the clasps into the loops, and you shall fasten the " |
| 255 | "tent together so that it will become one. And the overhanging " |
| 256 | "excess in the curtains of the tent half of the extra curtain " |
| 257 | "shall hang over the rear of the Mishkan. And the cubit from " |
| 258 | "here and the cubit from there of the excess in the length of " |
| 259 | "the curtains of the tent shall hang over the sides of the " |
| 260 | "Mishkan from here and from there to cover it. And you shall " |
| 261 | "make a covering for the tent of ram skins dyed red and a " |
| 262 | "covering of tachash skins above." ; |
| 263 | std::vector<char>::size_type len = strlen(s: c); |
| 264 | this->reserve(n: len); |
| 265 | this->insert(position: this->end(), first: c, last: c + len); |
| 266 | } |
| 267 | }; |
| 268 | |
| 269 | |
| 270 | //----------------------------------------------------------------------------// |
| 271 | |
| 272 | } } } // End namespaces test, iostreams, boost. |
| 273 | |
| 274 | #endif // #ifndef BOOST_IOSTREAMS_TEST_SEQUENCE_HPP_INCLUDED |
| 275 | |