danicoin/src/System/Ipv4Address.h

28 lines
652 B
C
Raw Normal View History

// Copyright (c) 2011-2016 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2014-09-15 10:48:45 +00:00
#pragma once
2015-05-27 12:08:46 +00:00
#include <cstdint>
#include <string>
2015-05-27 12:08:46 +00:00
namespace System {
2014-09-15 10:48:45 +00:00
2015-05-27 12:08:46 +00:00
class Ipv4Address {
2014-09-15 10:48:45 +00:00
public:
2015-05-27 12:08:46 +00:00
explicit Ipv4Address(uint32_t value);
explicit Ipv4Address(const std::string& dottedDecimal);
bool operator!=(const Ipv4Address& other) const;
bool operator==(const Ipv4Address& other) const;
uint32_t getValue() const;
bool isLoopback() const;
bool isPrivate() const;
std::string toDottedDecimal() const;
2014-09-15 10:48:45 +00:00
private:
2015-05-27 12:08:46 +00:00
uint32_t value;
2014-09-15 10:48:45 +00:00
};
}