text: /**
   * Copyright 2012 JDSU
   * File: ipv6address.h
   * Original author: Andy Lai (Andy.Lai@jdsu.com)
   * Purpose: definition of class IPv6Address
   */
  #ifndef XTREME_COMMON_PUBSUB_FILTER_IPV6ADDRESS_H_
  #define XTREME_COMMON_PUBSUB_FILTER_IPV6ADDRESS_H_
  #include <string>
  #include "xtreme/common/pubsub_filter/ipv6address_base.h"
  #include "xtreme/common/pubsub_filter/field_value_exception.h"
  namespace xtreme {
  namespace filter {
  class IPv6Address : public IPv6AddressBase {
   public:
    explicit IPv6Address(const std::string& value) throw(InvalidFieldValueException);
    explicit IPv6Address(const IPv6Address& value);
    bool operator ==(const IPv6Address& b) const;
    bool operator ==(const uint8_t* b) const;
  
    /*
     * maybe operator < for IPv6 Address is no actual sense, we just give it an implementation
     */
    bool operator <(const IPv6Address& b) const;
    bool operator <(const uint8_t* b) const;
  
    /*
     * maybe operator > for IPv6 Address is no actual sense, we just give it an implementation
     */
    bool operator >(const uint8_t* b) const;
    const uint8_t* GetValue() const {
      return value_;
    }
    bool IsValueSet() const;
    ~IPv6Address();
    // std::string ToString();
    static bool IsIPv6Address(const std::string& value, std::string &err);
  
   protected:
    // xtreme::IPAddress* p_ipaddr_base_;
    uint8_t prefix_len_;
    // bool shared_ipaddr_base_;
    uint8_t value_[16];
  
   private:
    uint8_t GetPrefixLen() const;
    static size_t Ipv6AddressStringToUINT(const std::string& str, uint8_t* ipv6, size_t len,
                                          IPv6Address* p_IPv6 = NULL)
      throw(InvalidFieldValueException);
    static int IPv6PartAddressStringToUINT8(const std::string& str, uint8_t* &p_ipv6)
    throw(InvalidFieldValueException);
  };
  }
  }
  #endif  // XTREME_COMMON_PUBSUB_FILTER_IPV6ADDRESS_H_
  