#include <CeylanIPAddressvFour.h>
Public Types | |
typedef Ceylan::Uint8 | IPvFourComponent |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
IPAddressvFour (IPvFourComponent first, IPvFourComponent second, IPvFourComponent third, IPvFourComponent fourth) | |
Constructs an IPv4 address from its four sub-components. | |
IPAddressvFour (const std::string &IPString) | |
Constructs an IPv4 from specified string, whose form must be that of "120.200.65.3". | |
virtual | ~IPAddressvFour () throw () |
Basic virtual destructor. | |
virtual NetworkAddressType | getType () const |
Returns the actual type of the IP address, IPv4. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns a user-friendly description of the state of this object. | |
Static Public Member Functions | |
static bool | IsValidIPv4 (const std::string &ipString) |
Returns whether IPString is a valid IP. | |
static bool | IsValid (const std::string IPString) |
Tells whether the specified string is a valid IP address. | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Protected Member Functions | |
virtual void | validate () const |
Checks that internal IP is valid. | |
Protected Attributes | |
IPvFourComponent | _first |
First IPv4 component. | |
IPvFourComponent | _second |
Second IPv4 component. | |
IPvFourComponent | _third |
Third IPv4 component. | |
IPvFourComponent | _fourth |
Fourth IPv4 component. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
IPAddressvFour (const IPAddressvFour &source) | |
Copy constructor made private to ensure that it will never be called. | |
IPAddressvFour & | operator= (const IPAddressvFour &source) |
Assignment operator made private to ensure that it will never be called. |
Definition at line 48 of file CeylanIPAddressvFour.h.
Definition at line 57 of file CeylanIPAddressvFour.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
IPAddressvFour::IPAddressvFour | ( | IPvFourComponent | first, | |
IPvFourComponent | second, | |||
IPvFourComponent | third, | |||
IPvFourComponent | fourth | |||
) |
Constructs an IPv4 address from its four sub-components.
Example: 'IPAddressvFour( 120, 200, 65, 3)' constructs the IPv4 address '120.200.65.3'
NetworkException | is the specified arguments are not valid. |
Definition at line 49 of file CeylanIPAddressvFour.cc.
References validate().
IPAddressvFour::IPAddressvFour | ( | const std::string & | IPString | ) | [explicit] |
Constructs an IPv4 from specified string, whose form must be that of "120.200.65.3".
NetworkException | if the string does not contain a representation of a valid IPv4 address. |
Definition at line 67 of file CeylanIPAddressvFour.cc.
References _first, _fourth, _second, _third, Ceylan::toString(), and validate().
IPAddressvFour::~IPAddressvFour | ( | ) | throw () [virtual] |
Ceylan::Network::IPAddressvFour::IPAddressvFour | ( | const IPAddressvFour & | source | ) | [private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
NetworkAddressType IPAddressvFour::getType | ( | ) | const [virtual] |
Returns the actual type of the IP address, IPv4.
Implements Ceylan::Network::IPAddress.
Definition at line 196 of file CeylanIPAddressvFour.cc.
References Ceylan::Network::IPv4.
bool IPAddress::IsValid | ( | const std::string | IPString | ) | [static, inherited] |
Tells whether the specified string is a valid IP address.
Definition at line 61 of file CeylanIPAddress.cc.
References generalUtils::false.
bool IPAddressvFour::IsValidIPv4 | ( | const std::string & | ipString | ) | [static] |
Returns whether IPString is a valid IP.
Definition at line 217 of file CeylanIPAddressvFour.cc.
References dataUtils::e, generalUtils::false, Ceylan::RegExp::matches(), and generalUtils::true.
IPAddressvFour& Ceylan::Network::IPAddressvFour::operator= | ( | const IPAddressvFour & | source | ) | [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string IPAddressvFour::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. For level 'Ceylanlow', the exact usual stringified IP will be returned (ex: "82.225.152.215"). |
Reimplemented from Ceylan::Network::IPAddress.
Definition at line 205 of file CeylanIPAddressvFour.cc.
References _first, _fourth, _second, _third, and Ceylan::toNumericalString().
Referenced by Ceylan::Network::ClientStreamSocket::connect().
void IPAddressvFour::validate | ( | ) | const [protected, virtual] |
Checks that internal IP is valid.
NetworkException | if the address is not valid. |
Implements Ceylan::Network::IPAddress.
Definition at line 256 of file CeylanIPAddressvFour.cc.
Referenced by IPAddressvFour().
First IPv4 component.
Definition at line 149 of file CeylanIPAddressvFour.h.
Referenced by IPAddressvFour(), and toString().
Fourth IPv4 component.
Definition at line 161 of file CeylanIPAddressvFour.h.
Referenced by IPAddressvFour(), and toString().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
Second IPv4 component.
Definition at line 153 of file CeylanIPAddressvFour.h.
Referenced by IPAddressvFour(), and toString().
Third IPv4 component.
Definition at line 157 of file CeylanIPAddressvFour.h.
Referenced by IPAddressvFour(), and toString().