00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef uripp_ipv6_address_h
00023 #define uripp_ipv6_address_h
00024 #include "apidefs.h"
00025 #include <string>
00026 #include <iostream>
00027 namespace uripp {
00047 class URIPP_API ipv6_address {
00048 public:
00049 ipv6_address();
00050
00051
00052
00053 ipv6_address(const std::string& v);
00055 bool is_null() const;
00060 std::string string(bool compress = false) const;
00063 std::ostream& write(std::ostream& os, bool compress = false) const;
00064 static const char SEPARATOR_CHAR;
00065 private:
00066 friend bool URIPP_API parse(std::string::const_iterator& first, std::string::const_iterator last, ipv6_address& v);
00067 bool zero_run(size_t& first, size_t& last) const;
00068 unsigned short hextets_[8];
00069 };
00071 inline std::ostream& operator <<(std::ostream& os, const ipv6_address& v) {return v.write(os);}
00075 bool URIPP_API parse(std::string::const_iterator& first, std::string::const_iterator last, ipv6_address& v);
00076 }
00077 #endif