sources/list.h

branch
protocol5
changeset 165
718a8c4df538
parent 164
e3794f48a589
child 179
7fc34735178e
equal deleted inserted replaced
160:cf514fa0f1cc 165:718a8c4df538
268 std::sort (begin(), end()); 268 std::sort (begin(), end());
269 } 269 }
270 270
271 Self splice(int start, int end, int step = 1) const 271 Self splice(int start, int end, int step = 1) const
272 { 272 {
273 start = clamp(start, 0, size() - 1); 273 start = clamp(start, 0, size());
274 end = clamp(end, 0, size() - 1); 274 end = clamp(end, 0, size());
275 275
276 if (end <= start) 276 if (end <= start)
277 { 277 {
278 return Self(); 278 return Self();
279 } 279 }
397 { 397 {
398 return data(); 398 return data();
399 } 399 }
400 }; 400 };
401 401
402 typedef Vector<unsigned char> ByteArray; 402 class ByteArray : public Vector<unsigned char>
403 {
404 public:
405 ByteArray(std::initializer_list<unsigned char> initializerList);
406
407 template<typename ...Args>
408 ByteArray(Args&& ...args);
409
410 class String quote() const;
411 };
412
413 /*!
414 * \brief Constructs a byte array by passing all arguments to Vector<unsigned char>'s constructor.
415 * \param args Arguments to pass.
416 */
417 template<typename ...Args>
418 ByteArray::ByteArray(Args&& ...args) :
419 Vector<unsigned char>(args...) {}
403 420
404 END_ZFC_NAMESPACE 421 END_ZFC_NAMESPACE

mercurial