Example #1
0
string c_haship_addr::get_hip_as_string(bool with_dots) const{
    string_as_hex dbg( string_as_bin(*this) );
    string hip(dbg.get());
    ostringstream out;
    for(auto it = hip.begin(); it < hip.end(); it++)
    {
        if(with_dots && it != hip.begin() && (it - hip.begin()) % 4 == 0)
            out << ':';
        out << *it;
    }
    return out.str();
}
Example #2
0
string_as_dbg::string_as_dbg(const char * data, size_t data_size)
	: string_as_dbg( string_as_bin( std::string(data,data_size) ) )
{ }
Example #3
0
void c_haship_addr::print(ostream &ostr) const {
	string_as_hex dbg( string_as_bin(*this) );
	ostr << "hip:" << dbg.get();
}