9#ifndef ZYPP_BYTEARRAY_H
10#define ZYPP_BYTEARRAY_H
18 class ByteArray :
public std::vector<char>
21 using vector<char>::vector;
22 explicit ByteArray (
const char *data,
const int len = -1 ) :
ByteArray( data, data + (len == -1 ? strlen(data) : len) ) { }
26 return std::string( data(), size() );
29#ifdef __cpp_lib_string_view
30 std::string_view asStringView ()
const {
32 return std::string_view();
33 return std::string_view( data(), size() );
38 class UByteArray :
public std::vector<unsigned char>
41 using vector<unsigned char>::vector;
42 explicit UByteArray (
const char *data,
const int len = -1 ) :
UByteArray( data, data + (len == -1 ? strlen(data) : len) ) { }
std::string asString() const
ByteArray(const char *data, const int len=-1)
UByteArray(const char *data, const int len=-1)
Easy-to use interface to the ZYPP dependency resolver.