Poco::OSP

class Version

Library: OSP
Package: Core
Header: Poco/OSP/Version.h

Description

This class represents a bundle version number in OSP. A version number consists of a major version number, a minor version number and a revision number. Optionally, a release designation can be specified.

A Version object can be formatted as a string. Also, a Version object can be constructed by parsing a string.

The string representation of a version number is <major>.<minor>.<revision>[-<designation>]

In a comparison, only major, minor and revision number are considered. The release designation is ignored.

Member Summary

Member Functions: designation, major, minor, operator !=, operator <, operator <=, operator =, operator ==, operator >, operator >=, parse, revision, swap, toString

Constructors

Version

Version();

Creates a Version with all numbers set to zero.

Version

Version(
    const Version & version
);

Creates a Version by copying another one.

Version

explicit Version(
    const std::string & version
);

Creates a Version from its string representation.

Version

Version(
    int major,
    int minor,
    int revision
);

Creates a Version from a major, minor and revision number.

Version

Version(
    int major,
    int minor,
    int revision,
    const std::string & designation
);

Creates a Version from a major, minor and revision number, as well as a release designation.

Destructor

~Version

~Version();

Destroys the Version.

Member Functions

designation inline

const std::string & designation() const;

Returns the release designation.

major inline

int major() const;

Returns the major version number.

minor inline

int minor() const;

Returns the minor version number.

operator !=

bool operator != (
    const Version & version
) const;

operator <

bool operator < (
    const Version & version
) const;

operator <=

bool operator <= (
    const Version & version
) const;

operator =

Version & operator = (
    const Version & version
);

Assigns another version.

operator =

Version & operator = (
    const std::string & version
);

Assigns a version parsed from a string.

operator ==

bool operator == (
    const Version & version
) const;

operator >

bool operator > (
    const Version & version
) const;

operator >=

bool operator >= (
    const Version & version
) const;

revision inline

int revision() const;

Returns the revision number.

swap

void swap(
    Version & version
);

Swaps the version with another one.

toString

std::string toString() const;

Returns a string representation of the version.

parse protected

void parse(
    const std::string & str
);

Parses the version from a string.

Securely control IoT edge devices from anywhere   Connect a Device