9 #ifndef __libutilxx__sella__variant__Binary_H__
10 #define __libutilxx__sella__variant__Binary_H__
12 #include "../../common.h"
13 #include "TypeCastException.h"
18 #include <boost/regex.hpp>
28 static const boost::regex & Pattern(
void) {
static boost::regex regex(
"^0x([0-9A-Fa-f]{2})*$");
return regex; }
29 static const int Type = 0x08;
33 Binary(
const std::string &value)
throw (TypeCastException);
34 Binary(
const std::vector<uint8_t> &value)
throw ();
37 virtual ~
Binary()
throw ();
40 bool operator==(
const Binary &other)
const throw ();
41 bool operator!=(
const Binary &other)
const throw ();
45 const std::vector<uint8_t>&
get()
const throw (UnsupportedOperatorException);
46 std::vector<uint8_t>&
get()
throw (UnsupportedOperatorException);
48 size_t size()
const throw ();
49 bool empty()
const throw ();
50 void clear()
throw ();
57 virtual void msgpackBufferSize(
size_t &size)
const throw ();
58 virtual std::string str(
int type)
const throw ();
59 virtual int getType(
void)
throw () {
return Type; }
61 static bool isType(
const std::string &value)
throw () {
return isType(value.c_str(), value.size()); }
62 static bool isType(
const char *value,
size_t size)
throw ();